zavro

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadValue = errors.New("bad zng value in kavro translator")

These errors shouldn't happen because the input should be type checked.

Functions

func Decode

func Decode(b *zcode.Builder, in []byte, schema avro.Schema) error

func DecodeSchema

func DecodeSchema(zctx *zed.Context, schema avro.Schema) (zed.Type, error)

func Encode

func Encode(dst []byte, id uint32, zv zed.Value) ([]byte, error)

func EncodeSchema

func EncodeSchema(typ zed.Type, namespace string) (avro.Schema, error)

Types

type Decoder

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

func NewDecoder

func NewDecoder(registry *srclient.SchemaRegistryClient, zctx *zed.Context) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(b []byte) (zed.Value, error)

type Encoder

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

func NewEncoder

func NewEncoder(namespace string, registry *srclient.SchemaRegistryClient) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(val zed.Value) ([]byte, error)

type MicroTimeSchema

type MicroTimeSchema struct{}

MicroTimeSchema implements avro.Schema and represents Avro long type.

func (*MicroTimeSchema) GetName

func (*MicroTimeSchema) GetName() string

GetName returns a type name for this MicroTimeSchema.

func (*MicroTimeSchema) MarshalJSON

func (*MicroTimeSchema) MarshalJSON() ([]byte, error)

MarshalJSON serializes the given schema as JSON. Never returns an error.

func (*MicroTimeSchema) Prop

func (*MicroTimeSchema) Prop(key string) (interface{}, bool)

Prop doesn't return anything valuable for LongSchema.

func (*MicroTimeSchema) String

func (*MicroTimeSchema) String() string

Returns a JSON representation of LongSchema.

func (*MicroTimeSchema) Type

func (*MicroTimeSchema) Type() int

Type returns a type constant for this MicroTimeSchema.

func (*MicroTimeSchema) Validate

func (*MicroTimeSchema) Validate(v reflect.Value) bool

Validate checks whether the given value is writeable to this schema.

Jump to

Keyboard shortcuts

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