Documentation
¶
Index ¶
- func GetSchema(schema_registry_url string, id int) (avro.Schema, error)
- func IsSchemaIdValid(schema_id int) bool
- func PostSchema(schema avro.Schema, schema_registry_url string, subject string) (int, error)
- func PostSubjectCompatibilityLevel(compatibility_level compatibility_levels.CompatibilityLevel, ...) (compatibility_levels.CompatibilityLevel, error)
- type SchemaRegistryClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSchemaIdValid ¶
Just a function containing a basic logic to check if an id is valid or not
func PostSchema ¶
func PostSubjectCompatibilityLevel ¶
func PostSubjectCompatibilityLevel(compatibility_level compatibility_levels.CompatibilityLevel, schema_registry_url string, subject string) (compatibility_levels.CompatibilityLevel, error)
Function aimed at setting the compatibility level on a given subject. It received a predefined compatibility level, the url of a schema registry (to which it will attach the route towards the subject configuration) and the subject. The function will output the resulting compatibility level on the subject, together with eventual errors
Types ¶
type SchemaRegistryClient ¶
type SchemaRegistryClient struct {
// contains filtered or unexported fields
}
Struct aimed at representing the Client entitled to interact with the schema registry through http
func NewSchemaRegistryClient ¶
func NewSchemaRegistryClient(input_registry_url string, input_dynamic_subject string) *SchemaRegistryClient
Function aimed at providing a new client
func (*SchemaRegistryClient) GetSchemaByID ¶
func (client *SchemaRegistryClient) GetSchemaByID(id int) (avro.Schema, error)
func (*SchemaRegistryClient) GetSchemaID ¶
func (client *SchemaRegistryClient) GetSchemaID(schema avro.Schema) (int, error)
Method which return the id in the schema registry of a schema given a hamba avro Schema interface. It will first query the internal cache, and then if the schema is not present, it will send a Post request for the schema id via http to the schema registry.