schema

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TypeAvro = schema.TypeAvro
)

Variables

View Source
var (
	ErrSubjectNotFound = pconnutils.ErrSubjectNotFound
	ErrVersionNotFound = pconnutils.ErrVersionNotFound
	ErrInvalidSchema   = pconnutils.ErrInvalidSchema

	ErrUnsupportedType = schema.ErrUnsupportedType
)
View Source
var KnownSerdeFactories = schema.KnownSerdeFactories
View Source
var Service pconnutils.SchemaService = newCachedSchemaService(newInMemoryService())

Service is the schema service client that can be used to interact with the schema service. It is initialized with an in-memory service by default.

Functions

func AttachKeySchemaToRecord added in v0.10.1

func AttachKeySchemaToRecord(r opencdc.Record, s Schema)

func AttachPayloadSchemaToRecord added in v0.10.1

func AttachPayloadSchemaToRecord(r opencdc.Record, s Schema)

func GetSchemaContextName

func GetSchemaContextName(ctx context.Context) string

GetSchemaContextName fetches the schema context name from the context. If the context does not contain a schema context name it returns an empty string.

func WithSchemaContextName

func WithSchemaContextName(ctx context.Context, schemaCtxName string) context.Context

WithSchemaContextName wraps ctx and returns a context that contains the provided schema context name.

Types

type Schema added in v0.10.1

type Schema = schema.Schema

Schema represents a schema object.

func Create

func Create(ctx context.Context, typ Type, subject string, bytes []byte) (Schema, error)

Create creates a new schema with the given name and bytes. The schema type must be Avro.

func Get

func Get(ctx context.Context, subject string, version int) (Schema, error)

Get retrieves the schema with the given name and version. If the schema does not exist, an error is returned.

type Serde added in v0.10.1

type Serde = schema.Serde

Serde represents a serializer/deserializer.

type Type added in v0.10.1

type Type = schema.Type

Type represents the type of a schema (avro, protobuf, etc).

Jump to

Keyboard shortcuts

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