schemaregistry

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(
	registry SchemaRegistry,
	topic string,
	scheme string,
	key bool,
) (int, bool, error)

CreateSchema creates schema for both key and value of the topic

Types

type Schema

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

func GetLatestSchemaWithRetry

func GetLatestSchemaWithRetry(
	registry SchemaRegistry,
	topic string,
	key bool,
	attempts int,
) (
	*Schema,
	error,
)

GetLatestSchemaWithRetry gets the schema from registry everytime

func GetSchemaWithRetry

func GetSchemaWithRetry(
	registry SchemaRegistry,
	schemaId int,
	attempts int,
) (
	*Schema,
	error,
)

GetSchemaWithRetry gets the schema from registry, it gives cached response

func (*Schema) Codec

func (schema *Schema) Codec() *goavro.Codec

func (*Schema) ID

func (schema *Schema) ID() int

func (*Schema) Schema

func (schema *Schema) Schema() string

func (*Schema) Version

func (schema *Schema) Version() int

type SchemaRegistry

type SchemaRegistry interface {
	GetSchema(schemaID int) (*Schema, error)
	GetLatestSchema(subject string, key bool) (*Schema, error)
	CreateSchema(subject string, scheme string, schemaType SchemaType, key bool) (*Schema, error)
}

SchemaRegistry supports multiple schema registries. An adapter interface to support various schema registries out there! at present it supports only one(cSchemaRegistry)

func NewRegistry

func NewRegistry(url string) SchemaRegistry

type SchemaType

type SchemaType string
const (
	Avro SchemaType = "AVRO"
)

Jump to

Keyboard shortcuts

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