types

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2017 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const UTIL_FILE = "primitive.go"

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field interface {
	// The field name
	Name() string
	// The friendly type name
	FieldType() string
	// The corresponding Go type
	GoType() string
	// The name of the method which writes this field onto the wire
	SerializerMethod() string
	// The name of the method which reads this field off the wire
	DeserializerMethod() string
	// Add the imports and struct for the definition of this type to the generator.Package
	AddStruct(*generator.Package)
	// Add the imports, methods and structs required for the serializer to the generator.Package
	AddSerializer(*generator.Package)
	// Add the imports, methods and structs required for the deserializer to the generator.Package
	AddDeserializer(*generator.Package)
}

type RecordDefinition

type RecordDefinition struct {
	// contains filtered or unexported fields
}

func RecordDefinitionForSchema

func RecordDefinitionForSchema(schemaJson []byte) (*RecordDefinition, error)

Given a JSON record definition as a JSON encoded string, deserialize the JSON and build the record definition structs

func (*RecordDefinition) AddDeserializer

func (r *RecordDefinition) AddDeserializer(p *generator.Package)

func (*RecordDefinition) AddSerializer

func (r *RecordDefinition) AddSerializer(p *generator.Package)

func (*RecordDefinition) AddStruct

func (r *RecordDefinition) AddStruct(p *generator.Package)

func (*RecordDefinition) GoType

func (r *RecordDefinition) GoType() string

type RequiredMapKeyError

type RequiredMapKeyError struct {
	Key string
}

func NewRequiredMapKeyError

func NewRequiredMapKeyError(key string) *RequiredMapKeyError

func (*RequiredMapKeyError) Error

func (r *RequiredMapKeyError) Error() string

type SchemaError

type SchemaError struct {
	FieldName   string
	NestedError error
}

func NewSchemaError

func NewSchemaError(fieldName string, err error) *SchemaError

func (*SchemaError) Error

func (s *SchemaError) Error() string

type WrongMapValueTypeError

type WrongMapValueTypeError struct {
	Key          string
	ExpectedType string
	ActualValue  interface{}
}

func NewWrongMapValueTypeError

func NewWrongMapValueTypeError(key, expectedType string, actualValue interface{}) *WrongMapValueTypeError

func (*WrongMapValueTypeError) Error

func (w *WrongMapValueTypeError) Error() string

Jump to

Keyboard shortcuts

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