structform

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 1 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayValueVisitor

type ArrayValueVisitor interface {
	OnBoolArray([]bool) error

	OnStringArray([]string) error

	// int
	OnInt8Array([]int8) error
	OnInt16Array([]int16) error
	OnInt32Array([]int32) error
	OnInt64Array([]int64) error
	OnIntArray([]int) error

	// uint
	OnBytes([]byte) error
	OnUint8Array([]uint8) error
	OnUint16Array([]uint16) error
	OnUint32Array([]uint32) error
	OnUint64Array([]uint64) error
	OnUintArray([]uint) error

	// float
	OnFloat32Array([]float32) error
	OnFloat64Array([]float64) error
}

ArrayValueVisitor passes arrays with known type. Implementation of ArrayValueVisitor is optional.

type ArrayVisitor

type ArrayVisitor interface {
	OnArrayStart(len int, baseType BaseType) error
	OnArrayFinished() error
}

ArrayVisitor iterates all entries in a list/array like structure

type BaseType

type BaseType uint8
const (
	AnyType BaseType = iota
	ByteType
	StringType
	BoolType
	ZeroType
	IntType
	Int8Type
	Int16Type
	Int32Type
	Int64Type
	UintType
	Uint8Type
	Uint16Type
	Uint32Type
	Uint64Type
	Float32Type
	Float64Type
)

func (BaseType) String

func (i BaseType) String() string

type ExtVisitor

func EnsureExtVisitor

func EnsureExtVisitor(v Visitor) ExtVisitor

type ObjectValueVisitor

type ObjectValueVisitor interface {
	OnBoolObject(map[string]bool) error

	OnStringObject(map[string]string) error

	// int
	OnInt8Object(map[string]int8) error
	OnInt16Object(map[string]int16) error
	OnInt32Object(map[string]int32) error
	OnInt64Object(map[string]int64) error
	OnIntObject(map[string]int) error

	// uint
	OnUint8Object(map[string]uint8) error
	OnUint16Object(map[string]uint16) error
	OnUint32Object(map[string]uint32) error
	OnUint64Object(map[string]uint64) error
	OnUintObject(map[string]uint) error

	// float
	OnFloat32Object(map[string]float32) error
	OnFloat64Object(map[string]float64) error
}

ObjectValueVisitor passes map[string]T. Implementation of ObjectValueVisitor is optional.

type ObjectVisitor

type ObjectVisitor interface {
	OnObjectStart(len int, baseType BaseType) error
	OnObjectFinished() error
	OnKey(s string) error
}

ObjectVisitor iterates all fields in a dictionary like structure

type StringRefVisitor

type StringRefVisitor interface {
	OnStringRef(s []byte) error
	OnKeyRef(s []byte) error
}

StringRefVisitor handles strings by reference into a byte string. The reference must be processed immediately, as the string passed might get overwritten after the callback returns.

func MakeStringRefVisitor

func MakeStringRefVisitor(v Visitor) StringRefVisitor

type ValueVisitor

type ValueVisitor interface {
	OnNil() error

	OnBool(b bool) error

	OnString(s string) error

	// int
	OnInt8(i int8) error
	OnInt16(i int16) error
	OnInt32(i int32) error
	OnInt64(i int64) error
	OnInt(i int) error

	// uint
	OnByte(b byte) error
	OnUint8(u uint8) error
	OnUint16(u uint16) error
	OnUint32(u uint32) error
	OnUint64(u uint64) error
	OnUint(u uint) error

	// float
	OnFloat32(f float32) error
	OnFloat64(f float64) error
}

ValueVisitor reports actual values in a structure being iterated

type Visitor

type Visitor interface {
	ObjectVisitor
	ArrayVisitor
	ValueVisitor
}

Visitor interface for iterating some structured input

Directories

Path Synopsis
This file has been generated from 'fold_map_inline.yml', do not edit This file has been generated from 'fold_refl_sel.yml', do not edit This file has been generated from 'stacks.yml', do not edit This file has been generated from 'unfold_arr.yml', do not edit This file has been generated from 'unfold_err.yml', do not edit This file has been generated from 'unfold_ignore.yml', do not edit This file has been generated from 'unfold_lookup_go.yml', do not edit This file has been generated from 'unfold_map.yml', do not edit This file has been generated from 'unfold_primitive.yml', do not edit This file has been generated from 'unfold_refl.yml', do not edit
This file has been generated from 'fold_map_inline.yml', do not edit This file has been generated from 'fold_refl_sel.yml', do not edit This file has been generated from 'stacks.yml', do not edit This file has been generated from 'unfold_arr.yml', do not edit This file has been generated from 'unfold_err.yml', do not edit This file has been generated from 'unfold_ignore.yml', do not edit This file has been generated from 'unfold_lookup_go.yml', do not edit This file has been generated from 'unfold_map.yml', do not edit This file has been generated from 'unfold_primitive.yml', do not edit This file has been generated from 'unfold_refl.yml', do not edit
internal
gen

Jump to

Keyboard shortcuts

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