avro

package
v0.0.0-...-47b5856 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 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"}
)
View Source
var NullValue nullValueType

NullValue is useful for setting Defaults in case of optional fields.

Functions

func ParseSchema

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 Decimal

func Decimal(name string, size, precision, scale int) Schema

func Fixed

func Fixed(name string, size int) 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