registry

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSchemaID             = errors.New("invalid schema ID")
	ErrInvalidDataWireFormat       = errors.New("invalid data wire format")
	ErrMarshalOperationUnsupported = errors.New("marshal operation unsupported")
	ErrUnableToResolveSchema       = errors.New("unable to resolve schema")
	ErrUnableToSetupRegistry       = errors.New("unable to setup registry")
	ErrCreateOrUpdateSchemaFailed  = errors.New("failed to create or update schema")
	ErrSchemaNotFound              = errors.New("schema not found")
)

Functions

This section is empty.

Types

type Fetcher added in v0.0.3

type Fetcher interface {
	Get(ctx context.Context, id string) (schema string, err error)
	GetByDefinition(ctx context.Context, schema avro.Schema) (id string, err error)
}

type PersistConfig added in v0.0.3

type PersistConfig struct {
	Resolver func(schema *avro.RecordSchema) (id string, version int, err error)
}

type Persister added in v0.0.3

type Persister interface {
	Persist(ctx context.Context, schema *avro.RecordSchema, opts ...func(*PersistConfig)) (id string, err error)
}

type Registry

type Registry struct {
	WireFormatter
	// contains filtered or unexported fields
}

func New added in v0.0.3

func New(fetcher Fetcher, persister Persister, wf WireFormatter) *Registry

func (*Registry) API added in v0.0.2

func (r *Registry) API() avro.API

API implements Register.

func (*Registry) GetCurrent added in v0.0.3

func (r *Registry) GetCurrent(ctx context.Context, v schemaIDGetter) (schemaID string, schema *avro.RecordSchema, batchSchema *avro.ArraySchema, err error)

func (*Registry) GetSchema added in v0.0.3

func (r *Registry) GetSchema(ctx context.Context, id string) (string, *avro.RecordSchema, *avro.ArraySchema, error)

GetSchema implements Register.

func (*Registry) Setup

func (r *Registry) Setup(ctx context.Context, schema avro.Schema, opts ...func(*RegistryConfig)) error

Setup implements Register.

type RegistryConfig

type RegistryConfig struct {
	Namespace      bool
	PersistCurrent bool
}

type WalkConfig added in v0.0.3

type WalkConfig struct {
	Namespaces []string
}

type Walker added in v0.0.3

type Walker interface {
	Walk(ctx context.Context, fn func(id string, version int64, latest bool, schema *avro.RecordSchema) error, opts ...func(*WalkConfig)) (int, error)
}

type WireFormatter added in v0.0.3

type WireFormatter interface {
	ExtractSchemaID(data []byte) (string, []byte, error)
	AppendSchemaID(data []byte, id string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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