Documentation ¶
Index ¶
- Constants
- type Client
- type Compatibility
- type Config
- type Option
- func WithBasicAuth(username, password string) Option
- func WithConnectionTimeout(d time.Duration) Option
- func WithRequestTimeout(d time.Duration) Option
- func WithSASLAuth(mechanism, username, password string) Option
- func WithSSL(certLocation, caLocation, keyLocation string, disableVerify bool) Option
- func WithURL(url string) Option
- type Reference
- type RestError
- type SchemaInfo
- type SchemaMetadata
Constants ¶
const ( // None is no compatibility. None // Backward compatibility. Backward // Forward compatibility. Forward // Full compatibility. Full // BackwardTransitive compatibility. BackwardTransitive // ForwardTransitive compatibility. ForwardTransitive // FullTransitive compatibility. FullTransitive )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Register(subject string, schema SchemaInfo, normalize bool) (int, error) GetBySubjectAndID(subject string, id int) (SchemaInfo, error) GetID(subject string, schema SchemaInfo, normalize bool) (int, error) GetLatestSchemaMetadata(subject string) (SchemaMetadata, error) GetSchemaMetadata(subject string, version int) (SchemaMetadata, error) GetAllVersions(subject string) ([]int, error) GetVersion(subject string, schema SchemaInfo, normalize bool) (int, error) GetAllSubjects() ([]string, error) DeleteSubject(subject string, permanent bool) ([]int, error) DeleteSubjectVersion(subject string, version int, permanent bool) (int, error) GetCompatibility(subject string) (compatibility Compatibility, err error) UpdateCompatibility(subject string, update Compatibility) (Compatibility, error) TestCompatibility(subject string, version int, schema SchemaInfo) (bool, error) GetDefaultCompatibility() (Compatibility, error) UpdateDefaultCompatibility(update Compatibility) (Compatibility, error) }
Client is an interface for clients interacting with the Confluent Schema Registry.
func NewMockClient ¶
NewMockClient returns a mock Client implementation.
type Compatibility ¶
type Compatibility int
Compatibility options.
func (Compatibility) MarshalJSON ¶
func (c Compatibility) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*Compatibility) ParseString ¶
func (c *Compatibility) ParseString(val string) error
ParseString returns a Compatibility for the given string.
func (Compatibility) String ¶
func (c Compatibility) String() string
func (*Compatibility) UnmarshalJSON ¶
func (c *Compatibility) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Config ¶
type Config struct { URL string BasicAuthUserInfo string BasicAuthCredentialsSource string SASLMechanism string SASLUsername string SASLPassword string SSLCertificateLocation string SSLKeyLocation string SSLCaLocation string SSLDisableEndpointVerification bool ConnectionTimeout time.Duration RequestTimeout time.Duration CacheCapacity int }
Config is used to pass multiple configuration options to the Schema Registry client.
type Option ¶
type Option func(*Config)
Option is used to pass configuration options to the Schema registry client.
func WithBasicAuth ¶
WithBasictAuth sets the username and password for basic authentication. Default source: USER_INFO.
func WithConnectionTimeout ¶
WithConnectionTimeout sets the connection timeout.
func WithRequestTimeout ¶
WithRequestTimeout sets the request timeout.
func WithSASLAuth ¶
WithSASLAuth sets the SASL mechanism.
type Reference ¶
type Reference struct { Name string `json:"name"` Subject string `json:"subject"` Version int `json:"version"` }
Reference represents a schema reference.
type SchemaInfo ¶
type SchemaInfo struct { Schema string `json:"schema,omitempty"` SchemaType string `json:"schemaType,omitempty"` References []Reference `json:"references,omitempty"` }
SchemaInfo represents basic schema information.
func (*SchemaInfo) MarshalJSON ¶
func (sd *SchemaInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*SchemaInfo) UnmarshalJSON ¶
func (sd *SchemaInfo) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.
type SchemaMetadata ¶
type SchemaMetadata struct { SchemaInfo ID int `json:"id,omitempty"` Subject string `json:"subject,omitempty"` Version int `json:"version,omitempty"` }
SchemaMetadata represents schema metadata.
func (*SchemaMetadata) MarshalJSON ¶
func (sd *SchemaMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*SchemaMetadata) UnmarshalJSON ¶
func (sd *SchemaMetadata) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.