avro

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package monitoring contains a small DSL to help write more robust Avro schemas by taking advantage of go's type system.

Index

Constants

This section is empty.

Variables

View Source
var (
	Null    = primitive{"null"}
	Boolean = primitive{"boolean"}
	Int     = primitive{"int"}
	Long    = primitive{"long"}
	Double  = primitive{"double"}
	Bytes   = primitive{"bytes"}
	String  = primitive{"string"}
)

Functions

func ParseSchema added in v0.1.2

func ParseSchema(schema Schema) (jsonEncodedSchema string, codec *goavro.Codec, err error)

Types

type Fields

type Fields []IField

type IField

type IField interface {
	IsField()
}

func Field

func Field(name string, opts Opts, typ Schema) IField

type Opts

type Opts struct {
	Doc       string
	Namespace string
	Default   interface{}
}

Opts represents the optional fields of a complex type.

type Schema

type Schema interface {
	IsSchema()
}

func Array

func Array(items Schema) Schema

func Record

func Record(name string, opts Opts, fields Fields) Schema

type Union

type Union []Schema

func (Union) IsSchema

func (u Union) IsSchema()

Jump to

Keyboard shortcuts

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