common

package
v0.0.0-...-56e19d2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name     string
	Nullable bool
	Type     Type
	Metadata map[string]string
}

type FieldAssertion

type FieldAssertion func(t *testing.T, schema *Schema, index int)

type Fields

type Fields []Field

type Schema

type Schema struct {
	Fields Fields
}

func FromYaml

func FromYaml(path string) (*Schema, error)

func (*Schema) AssertField

func (schema *Schema) AssertField(t *testing.T, index int, name string, nullable bool, tpe Type)

func (*Schema) AssertSchema

func (schema *Schema) AssertSchema(t *testing.T, assertions []FieldAssertion)

type Type

type Type struct {
	Name   TypeName
	Values *Type
	Fields *Fields
}

Type is either a scalar type, for which TypeName will be: - BooleanType - ByteType - ShortType - IntType - LongType - UByteType - UShortType - UIntType - ULongType - FloatType - DoubleType - BytesType - Utf8Type and Values, Fields will be nil or an ArrayType (TypeName will be ArrayType), Values will be another Type definition and Fields will be nil or a StructureType (TypeName will be StructureType), Values will be nil and Fields will be set with the fields of the structure.

type TypeName

type TypeName string
const (
	BooleanType   TypeName = "boolean"
	ByteType      TypeName = "byte"
	ShortType     TypeName = "short"
	IntType       TypeName = "int"
	LongType      TypeName = "long"
	UByteType     TypeName = "ubyte"
	UShortType    TypeName = "ushort"
	UIntType      TypeName = "uint"
	ULongType     TypeName = "ulong"
	FloatType     TypeName = "float"
	DoubleType    TypeName = "double"
	BytesType     TypeName = "bytes"
	Utf8Type      TypeName = "utf8"
	ArrayType     TypeName = "array"
	StructureType TypeName = "structure"
)

Jump to

Keyboard shortcuts

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