compiler

package
v10.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 5 Imported by: 182

Documentation

Overview

Compiler has methods to generate GADGT VM bytecode from Avro schemas

Index

Constants

This section is empty.

Variables

View Source
var (
	// Enable this to get debug logs for the compilation process
	LoggingEnabled = false
)

Functions

func Compile

func Compile(writer, reader schema.AvroType, opts ...Option) (*vm.Program, error)

Given two parsed Avro schemas, compile them into a program which can read the data written by `writer` and store it in the structs generated for `reader`.

func CompileSchemaBytes

func CompileSchemaBytes(writer, reader []byte, opts ...Option) (*vm.Program, error)

Given two Avro schemas, compile them into a program which can read the data written by `writer` and store it in the structs generated for `reader`. If you're reading records from an OCF you can use the New<RecordType>Reader() method that's generated for you, which will parse the schemas automatically.

func ParseSchema

func ParseSchema(s []byte) (schema.AvroType, error)

Types

type Option

type Option func(*irProgram)

func AllowLaxNames

func AllowLaxNames() Option

Jump to

Keyboard shortcuts

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