Documentation ¶
Index ¶
- Constants
- type Client
- type Compatibility
- type Config
- func NewConfig(url string) *Config
- func NewConfigWithAuthentication(url string, username string, password string) *Config
- func NewConfigWithBasicAuthentication(url string, username string, password string) *Config
- func NewConfigWithBearerAuthentication(url, token, targetSr, identityPoolID string) *Config
- type Metadata
- type Reference
- type RestError
- type Rule
- type RuleMode
- type RuleSet
- type SchemaInfo
- type SchemaMetadata
- type ServerConfig
Constants ¶
const ( // Upgrade denotes upgrade mode Upgrade = 1 // Downgrade denotes downgrade mode Downgrade = 2 // UpDown denotes upgrade/downgrade mode UpDown = 3 // Write denotes write mode Write = 4 // Read denotes read mode Read = 5 // WriteRead denotes write/read mode WriteRead = 6 )
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 { Config() *Config Register(subject string, schema SchemaInfo, normalize bool) (id int, err error) RegisterFullResponse(subject string, schema SchemaInfo, normalize bool) (result SchemaMetadata, err error) GetBySubjectAndID(subject string, id int) (schema SchemaInfo, err error) GetID(subject string, schema SchemaInfo, normalize bool) (id int, err error) GetLatestSchemaMetadata(subject string) (SchemaMetadata, error) GetSchemaMetadata(subject string, version int) (SchemaMetadata, error) GetSchemaMetadataIncludeDeleted(subject string, version int, deleted bool) (SchemaMetadata, error) GetLatestWithMetadata(subject string, metadata map[string]string, deleted bool) (SchemaMetadata, error) GetAllVersions(subject string) ([]int, error) GetVersion(subject string, schema SchemaInfo, normalize bool) (version int, err error) GetAllSubjects() ([]string, error) DeleteSubject(subject string, permanent bool) ([]int, error) DeleteSubjectVersion(subject string, version int, permanent bool) (deletes int, err error) TestSubjectCompatibility(subject string, schema SchemaInfo) (compatible bool, err error) TestCompatibility(subject string, version int, schema SchemaInfo) (compatible bool, err error) GetCompatibility(subject string) (compatibility Compatibility, err error) UpdateCompatibility(subject string, update Compatibility) (compatibility Compatibility, err error) GetDefaultCompatibility() (compatibility Compatibility, err error) UpdateDefaultCompatibility(update Compatibility) (compatibility Compatibility, err error) GetConfig(subject string, defaultToGlobal bool) (result ServerConfig, err error) UpdateConfig(subject string, update ServerConfig) (result ServerConfig, err error) GetDefaultConfig() (result ServerConfig, err error) UpdateDefaultConfig(update ServerConfig) (result ServerConfig, err error) Close() error }
Client is an interface for clients interacting with the Confluent Schema Registry. The Schema Registry's REST interface is further explained in Confluent's Schema Registry API documentation https://github.com/confluentinc/schema-registry/blob/master/client/src/main/java/io/confluent/kafka/schemaregistry/client/SchemaRegistryClient.java
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 {
internal.ClientConfig
}
Config is used to pass multiple configuration options to the Schema Registry client.
func NewConfigWithAuthentication ¶
NewConfigWithAuthentication returns a new configuration instance using basic authentication. For Confluent Cloud, use the API key for the username and the API secret for the password. This method is deprecated.
func NewConfigWithBasicAuthentication ¶ added in v2.4.0
NewConfigWithBasicAuthentication returns a new configuration instance using basic authentication. For Confluent Cloud, use the API key for the username and the API secret for the password.
func NewConfigWithBearerAuthentication ¶ added in v2.4.0
NewConfigWithBearerAuthentication returns a new configuration instance using bearer authentication. For Confluent Cloud, targetSr(`bearer.auth.logical.cluster` and identityPoolID(`bearer.auth.identity.pool.id`) is required
type Metadata ¶ added in v2.5.0
type Metadata struct { Tags map[string][]string `json:"tags,omitempty"` Properties map[string]string `json:"properties,omitempty"` Sensitive []string `json:"sensitive,omitempty"` }
Metadata represents user-defined metadata
type Reference ¶
type Reference struct { Name string `json:"name"` Subject string `json:"subject"` Version int `json:"version"` }
Reference represents a schema reference
type Rule ¶ added in v2.5.0
type Rule struct { // Rule name Name string `json:"name,omitempty"` // Rule doc Doc string `json:"doc,omitempty"` // Rule kind Kind string `json:"kind,omitempty"` // Rule mode Mode string `json:"mode,omitempty"` // Rule type Type string `json:"type,omitempty"` // The tags to which this rule applies Tags []string `json:"tags,omitempty"` // Optional params for the rule Params map[string]string `json:"params,omitempty"` // Rule expression Expr string `json:"expr,omitempty"` // Rule action on success OnSuccess string `json:"onSuccess,omitempty"` // Rule action on failure OnFailure string `json:"onFailure,omitempty"` // Whether the rule is disabled Disabled bool `json:"disabled,omitempty"` }
Rule represents a data contract rule
type RuleSet ¶ added in v2.5.0
type RuleSet struct { MigrationRules []Rule `json:"migrationRules,omitempty"` DomainRules []Rule `json:"domainRules,omitempty"` }
RuleSet represents a data contract rule set
type SchemaInfo ¶
type SchemaInfo struct { Schema string `json:"schema,omitempty"` SchemaType string `json:"schemaType,omitempty"` References []Reference `json:"references,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` RuleSet *RuleSet `json:"ruleSet,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
type ServerConfig ¶ added in v2.5.0
type ServerConfig struct { Alias string `json:"alias,omitempty"` Normalize bool `json:"normalize,omitempty"` CompatibilityUpdate Compatibility `json:"compatibility,omitempty"` CompatibilityLevel Compatibility `json:"compatibilityLevel,omitempty"` CompatibilityGroup string `json:"compatibilityGroup,omitempty"` DefaultMetadata *Metadata `json:"defaultMetadata,omitempty"` OverrideMetadata *Metadata `json:"overrideMetadata,omitempty"` DefaultRuleSet *RuleSet `json:"defaultRuleSet,omitempty"` OverrideRuleSet *RuleSet `json:"overrideRuleSet,omitempty"` }
ServerConfig represents config params for Schema Registry
NOTE: GET uses compatibilityLevel, POST uses compatibility
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
rules
|
|
Code generated by github.com/actgardner/gogen-avro/v10.
|
Code generated by github.com/actgardner/gogen-avro/v10. |