schemaclient

package module
v0.0.0-...-33a089b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

Build Status

schemaclient

Go Schema Registry Client

Install

go get -u github.com/goavro/schemaclient

Documentation

Index

Constants

View Source
const (
	GET_SCHEMA_BY_ID             = "/schemas/ids/%d"
	GET_SUBJECTS                 = "/subjects"
	GET_SUBJECT_VERSIONS         = "/subjects/%s/versions"
	GET_SPECIFIC_SUBJECT_VERSION = "/subjects/%s/versions/%s"
	REGISTER_NEW_SCHEMA          = "/subjects/%s/versions"
	CHECK_IS_REGISTERED          = "/subjects/%s"
	TEST_COMPATIBILITY           = "/compatibility/subjects/%s/versions/%s"
	CONFIG                       = "/config"
)
View Source
const (
	SCHEMA_REGISTRY_V1_JSON               = "application/vnd.schemaregistry.v1+json"
	SCHEMA_REGISTRY_V1_JSON_WEIGHTED      = "application/vnd.schemaregistry.v1+json"
	SCHEMA_REGISTRY_MOST_SPECIFIC_DEFAULT = "application/vnd.schemaregistry.v1+json"
	SCHEMA_REGISTRY_DEFAULT_JSON          = "application/vnd.schemaregistry+json"
	SCHEMA_REGISTRY_DEFAULT_JSON_WEIGHTED = "application/vnd.schemaregistry+json qs=0.9"
	JSON                                  = "application/json"
	JSON_WEIGHTED                         = "application/json qs=0.5"
	GENERIC_REQUEST                       = "application/octet-stream"
)

Variables

Functions

This section is empty.

Types

type CachedSchemaRegistryClient

type CachedSchemaRegistryClient struct {
	// contains filtered or unexported fields
}

func NewCachedSchemaRegistryClient

func NewCachedSchemaRegistryClient(registryURL string) *CachedSchemaRegistryClient

func NewCachedSchemaRegistryClientAuth

func NewCachedSchemaRegistryClientAuth(registryURL string, auth *RegistryAuth) *CachedSchemaRegistryClient

func (*CachedSchemaRegistryClient) GetByID

func (this *CachedSchemaRegistryClient) GetByID(id int32) (avro.Schema, error)

func (*CachedSchemaRegistryClient) GetLatestSchemaMetadata

func (this *CachedSchemaRegistryClient) GetLatestSchemaMetadata(subject string) (*SchemaMetadata, error)

func (*CachedSchemaRegistryClient) GetVersion

func (this *CachedSchemaRegistryClient) GetVersion(subject string, schema avro.Schema) (int32, error)

func (*CachedSchemaRegistryClient) Register

func (this *CachedSchemaRegistryClient) Register(subject string, schema avro.Schema) (int32, error)

type CompatibilityLevel

type CompatibilityLevel string
const (
	BackwardCompatibilityLevel CompatibilityLevel = "BACKWARD"
	ForwardCompatibilityLevel  CompatibilityLevel = "FORWARD"
	FullCompatibilityLevel     CompatibilityLevel = "FULL"
	NoneCompatibilityLevel     CompatibilityLevel = "NONE"
)

type ErrorMessage

type ErrorMessage struct {
	Error_code int32
	Message    string
}

func (*ErrorMessage) Error

func (this *ErrorMessage) Error() string

type GetSchemaResponse

type GetSchemaResponse struct {
	Schema string
}

type GetSubjectVersionResponse

type GetSubjectVersionResponse struct {
	Subject string
	Version int32
	Id      int32
	Schema  string
}

type RegisterSchemaResponse

type RegisterSchemaResponse struct {
	Id int32
}

type RegistryAuth

type RegistryAuth struct {
	User string
	Key  string
}

func NewRegistryAuth

func NewRegistryAuth(user string, key string) *RegistryAuth

type SchemaMetadata

type SchemaMetadata struct {
	Id      int32
	Version int32
	Schema  string
}

type SchemaRegistryClient

type SchemaRegistryClient interface {
	Register(subject string, schema avro.Schema) (int32, error)
	GetByID(id int32) (avro.Schema, error)
	GetLatestSchemaMetadata(subject string) (*SchemaMetadata, error)
	GetVersion(subject string, schema avro.Schema) (int32, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL