-
Notifications
You must be signed in to change notification settings - Fork 697
Add Confluent-Client-Version header to requests to SR, Golang client #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,7 @@ import ( | |||||||||||||||||||||||||
| "strings" | ||||||||||||||||||||||||||
| "time" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| "github.com/confluentinc/confluent-kafka-go/v2/kafka" | ||||||||||||||||||||||||||
| "github.com/confluentinc/confluent-kafka-go/v2/schemaregistry/rest" | ||||||||||||||||||||||||||
| "golang.org/x/oauth2/clientcredentials" | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
@@ -85,6 +86,14 @@ const ( | |||||||||||||||||||||||||
| TargetIdentityPoolIDKey = "Confluent-Identity-Pool-Id" | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // getClientVersionHeaderValue returns the client version header value | ||||||||||||||||||||||||||
| // in the format "go/{version}" | ||||||||||||||||||||||||||
| // Note: currently the client version is tied to the librdkafka version | ||||||||||||||||||||||||||
| func getClientVersionHeaderValue() string { | ||||||||||||||||||||||||||
| _, version := kafka.LibraryVersion() | ||||||||||||||||||||||||||
| return "go/" + version | ||||||||||||||||||||||||||
|
Comment on lines
+89
to
+94
|
||||||||||||||||||||||||||
| // getClientVersionHeaderValue returns the client version header value | |
| // in the format "go/{version}" | |
| // Note: currently the client version is tied to the librdkafka version | |
| func getClientVersionHeaderValue() string { | |
| _, version := kafka.LibraryVersion() | |
| return "go/" + version | |
| // getClientVersionHeaderValue returns the Schema Registry client version header value | |
| // in the format "go/{version}" | |
| // Note: this version reflects the Schema Registry client, not the Kafka library version. | |
| const schemaRegistryClientVersion = "1.0.0" // TODO: Update this version as needed for releases | |
| func getClientVersionHeaderValue() string { | |
| return "go/" + schemaRegistryClientVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid the dependency of the SR client on Kafka?