avro

package
v3.4.30+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAvro

func FromAvro(data string) (*dosa.EntityDefinition, error)

FromAvro converts avro schema to dosa entity definition

func ToAvro

func ToAvro(namePrefix string, ed *dosa.EntityDefinition) ([]byte, error)

ToAvro converts dosa entity definition to avro schema

Types

type Field

type Field struct {
	Name       string      `json:"name,omitempty"`
	Doc        string      `json:"doc,omitempty"`
	Default    interface{} `json:"default"`
	Type       gv.Schema   `json:"type,omitempty"`
	Properties map[string]string
}

Field represents a schema field for Avro record.

func (*Field) MarshalJSON

func (s *Field) MarshalJSON() ([]byte, error)

MarshalJSON serializes the given schema field as JSON.

type Record

type Record struct {
	Name       string                 `json:"name,omitempty"`
	Namespace  string                 `json:"namespace,omitempty"`
	Doc        string                 `json:"doc,omitempty"`
	Aliases    []string               `json:"aliases,omitempty"`
	Properties map[string]interface{} `json:"meta, omitempty"`
	Fields     []*Field               `json:"fields"`
}

Record implements Schema and represents Avro record type.

func (*Record) MarshalJSON

func (s *Record) MarshalJSON() ([]byte, error)

MarshalJSON serializes the given schema as JSON.

func (*Record) String

func (s *Record) String() string

String returns a JSON representation of RecordSchema.

Jump to

Keyboard shortcuts

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