Documentation ¶
Index ¶
Constants ¶
const ( Base = ".." Schemas = "/schemas/ids/%d" SchemasBySubject = "/schemas/ids/%d?subject=%s" Subject = "/subjects" Subjects = Subject + "/%s" SubjectsNormalize = Subject + "/%s?normalize=%t" SubjectsDelete = Subjects + "?permanent=%t" LatestWithMetadata = Subjects + "/metadata?deleted=%t%s" Version = Subjects + "/versions" VersionNormalize = Subjects + "/versions?normalize=%t" Versions = Version + "/%v" VersionsIncludeDeleted = Versions + "?deleted=%t" VersionsDelete = Versions + "?permanent=%t" SubjectCompatibility = "/compatibility" + Version Compatibility = "/compatibility" + Versions Config = "/config" SubjectConfig = Config + "/%s" SubjectConfigDefault = SubjectConfig + "?defaultToGlobal=%t" Mode = "/mode" SubjectMode = Mode + "/%s" Keks = "/dek-registry/v1/keks" KekByName = Keks + "/%s?deleted=%t" Deks = Keks + "/%s/deks" DeksBySubject = Deks + "/%s?deleted=%t" DeksByVersion = Deks + "/%s/versions/%v?deleted=%t" TargetSRClusterKey = "Target-Sr-Cluster" TargetIdentityPoolIDKey = "Confluent-Identity-Pool-Id" )
Relative Confluent Schema Registry REST API endpoints as described in the Confluent documentation https://docs.confluent.io/current/schema-registry/docs/api.html
Variables ¶
This section is empty.
Functions ¶
func ConfigureTLS ¶
func ConfigureTLS(conf *ClientConfig, tlsConf *tls.Config) error
ConfigureTLS populates tlsConf
func NewAuthHeader ¶
NewAuthHeader returns a base64 encoded userinfo string identified on the configured credentials source
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API represents a REST API request
func NewRequest ¶
NewRequest returns new Confluent Schema Registry API request */
type ClientConfig ¶
type ClientConfig struct { // SchemaRegistryURL determines the URL of Schema Registry. SchemaRegistryURL string // BasicAuthUserInfo specifies the user info in the form of {username}:{password}. BasicAuthUserInfo string // BasicAuthCredentialsSource specifies how to determine the credentials, one of URL, USER_INFO, and SASL_INHERIT. BasicAuthCredentialsSource string // SaslMechanism specifies the SASL mechanism used for client connections, which defaults to GSSAPI. SaslMechanism string // SaslUsername specifies the username for SASL. SaslUsername string // SaslUsername specifies the password for SASL. SaslPassword string // BearerAuthToken specifies the token for authentication. BearerAuthToken string // BearerAuthCredentialsSource specifies how to determine the credentials. BearerAuthCredentialsSource string // BearerAuthLogicalCluster specifies the target SR logical cluster id. It is required for Confluent Cloud Schema Registry BearerAuthLogicalCluster string // BearerAuthIdentityPoolID specifies the identity pool ID. It is required for Confluent Cloud Schema Registry BearerAuthIdentityPoolID string // SslCertificateLocation specifies the location of SSL certificates. SslCertificateLocation string // SslKeyLocation specifies the location of SSL keys. SslKeyLocation string // SslCaLocation specifies the location of SSL certificate authorities. SslCaLocation string // SslDisableEndpointVerification determines whether to disable endpoint verification. SslDisableEndpointVerification bool // ConnectionTimeoutMs determines the connection timeout in milliseconds. ConnectionTimeoutMs int // RequestTimeoutMs determines the request timeout in milliseconds. RequestTimeoutMs int // CacheCapacity positive integer or zero for unbounded capacity CacheCapacity int // CacheLatestTTLSecs ttl in secs for caching the latest schema CacheLatestTTLSecs int // HTTP client HTTPClient *http.Client }
ClientConfig is used to pass multiple configuration options to the Schema Registry client.
type RestService ¶
RestService represents a REST client
func NewRestService ¶
func NewRestService(conf *ClientConfig) (*RestService, error)
NewRestService returns a new REST client for the Confluent Schema Registry
func (*RestService) HandleRequest ¶
func (rs *RestService) HandleRequest(request *API, response interface{}) error
HandleRequest sends a HTTP(S) request to the Schema Registry, placing results into the response object