tbin

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AnyTag = 0x10 // used only as a value for array items, map items and keys, and in defstruct.
View Source
const ArrayTag = 0x0d // "ARRAYTAG uvarint(size) value*"
View Source
const BoolTag = 0x01 // "uvarint(b? 1 : 0)"
View Source
const BytesTag = 0x08 // "BYTESTAG uvarint(len) byte*"
View Source
const CurVersionTag = VersionTag + (CurrentVersion - 1) // "0001 1000
View Source
const CurrentVersion = 1 // the first versioned version
View Source
const DefArrayTag = 0x11 // "<newtag> DefArrayTag itemsTag"
View Source
const DefEnumTag = 0x15 // "<newtag> DefEnumTag <count> (uvarint(symlen) symbytes*)*"
View Source
const DefMapTag = 0x12 // "<newtag> DefMapTag keysTag itemsTag"
View Source
const DefStructTag = 0x13 // "<newtag> DefStructTag <fieldcount> (uvarint(fnamelen) fnamebytes* ftypeTag)*"
View Source
const DefUnionTag = 0x14 // "<newtag> DefUnionTag <count> variantTag*"
View Source
const EnumTag = 0x17

EnumTag identifies unused, reserved tags.

View Source
const FirstUserTag = 0x40 //0x40..0x7f all fit in a single byte tag. Subsequent tags take more. The tag is an unsigned varint.
View Source
const Float32Tag = 0x06 // "FLOAT32TAG 4_bytes"
View Source
const Float64Tag = 0x07 // "FLOAT64TAG 8_bytes"
View Source
const Int16Tag = 0x03 // "INT16TAG varint(n)"
View Source
const Int32Tag = 0x04 // "INT32TAG varint(n)"
View Source
const Int64Tag = 0x05 // "INT64TAG varint(n)"
View Source
const Int8Tag = 0x02 // "INT8TAG varint(n)"
View Source
const MapTag = 0x0e // "MAPTAG uvarint(size) (<value> <value>)*"
View Source
const MaxVersion = VersionDataMask + 1
View Source
const MaxVersionTag = VersionTag + VersionDataMask
View Source
const MinVersionTag = VersionTag
View Source
const NullTag = 0x00 // "nil" or "null"
View Source
const StringTag = 0x09 // "STRINGTAG uvarint(utflen) utf8bytes*"
View Source
const StructTag = 0x0f // "STRUCTTAG uvarint(size) (<symbol> <value>)*" -- for generic structs (native Go structs are their ownb type/tag)
View Source
const SymbolTag = 0x0b // "SYMBOLTAG uvarint(id) [string(name)]" the name is only included the first occurrence
View Source
const TimestampTag = 0x0a // "TIMESTAMPTAG double" - represented as seconds since epoch (1970)
View Source
const TinyStrDataMask = 0x1f
View Source
const TinyStrMaxlen = TinyStrDataMask
View Source
const TinyStrTag = 0x20 // "001x xxxx" <utf8byte>*

TinyStrTag is for strings that have a length up to 31 utf8 bytes. Again, this optimization has no effect on packed structs, just the generic encoding (187->160 for my test data). If symbols are used instead of strings, the savings are even bigger. But maps have strings, not symbols, as keys.

View Source
const TinyStrTagMask = 0xe0
View Source
const UUIDTag = 0x0c // "UUIDTAG byte[16]" = written as 16 bytes, no count
View Source
const UnionTag = 0x16
View Source
const VersionDataMask = 0x07
View Source
const VersionTag = 0x18 // "uvarint(0001 1xxx)"

VersionTag should be the first tag in the stream. v1..v8 are thus supported, after which additional byte(s) will be required. Bits encode (version - 1), i.e. currently encoded "0001 0000".

View Source
const VersionTagMask = 0xf8

Variables

View Source
var Any = &Signature{Tag: AnyTag}
View Source
var Bool = &Signature{Tag: BoolTag}
View Source
var Bytes = &Signature{Tag: BytesTag}
View Source
var Float32 = &Signature{Tag: Float32Tag}
View Source
var Float64 = &Signature{Tag: Float64Tag}
View Source
var Int16 = &Signature{Tag: Int16Tag}
View Source
var Int32 = &Signature{Tag: Int32Tag}
View Source
var Int64 = &Signature{Tag: Int64Tag}
View Source
var Int8 = &Signature{Tag: Int8Tag}
View Source
var Null = &Signature{Tag: NullTag}
View Source
var String = &Signature{Tag: StringTag}
View Source
var Symbol = &Signature{Tag: SymbolTag}
View Source
var Timestamp = &Signature{Tag: TimestampTag}
View Source
var UUID = &Signature{Tag: UUIDTag}

Functions

func DecodeUvarint

func DecodeUvarint(in io.Reader) (uint, error)

DecodeUvarint decodes the uvarint from the Reader.

func DecodeVarint

func DecodeVarint(in io.Reader) (int, error)

DecodeVarint decodes the varint from the Reader.

func EncodeUvarint

func EncodeUvarint(out io.Writer, n int) error

EncodeUvarint encodes the uvarint to the Writer.

func EncodeVarint

func EncodeVarint(out io.Writer, n int) error

EncodeVarint encodes the varint to the Writer.

func Equal

func Equal(o1 interface{}, o2 interface{}) bool

func IsZero

func IsZero(v reflect.Value) bool

func Marshal

func Marshal(data interface{}) ([]byte, error)

Marshal - Marshal the specified data to TBin, returning a byte array or error.

func Pretty

func Pretty(o interface{}) string

func TagName

func TagName(tag int) string

TagName returns the tag name for the tag.

func Unmarshal

func Unmarshal(b []byte, data interface{}) error

Unmarshal - decode the TBin byte array into the specified target entity. If the target entity is a pointer to an interface{}, it will decode into the appropriate primitive types, along with map[string]interface{} for any structs and maps, and []interface{} for any arrays. If a pointer to a particular struct type is provided, it is filled with data as best it can, allocating substructure as needed. In this, it tries to imitate the encoding/json behavior.

func ValidMapKey

func ValidMapKey(key interface{}) bool

func ValidMapKeyType

func ValidMapKeyType(t reflect.Type) bool

Types

type AlphaName

type AlphaName string

AlphaName - AlphaName def one or more alpha characters

type ArrayOfInt

type ArrayOfInt []int32

ArrayOfInt -

type BigStruct

type BigStruct struct {
	MyName           string           `json:"myName"`
	MyUtfname        string           `json:"myUtfname"`
	MyBool           bool             `json:"myBool"`
	MyByte           int8             `json:"myByte"`
	MyShort          int16            `json:"myShort"`
	MyInt            int32            `json:"myInt"`
	MyLong           int64            `json:"myLong"`
	MyFloat          float32          `json:"myFloat"`
	MyDouble         float64          `json:"myDouble"`
	MyIntArray       []int32          `json:"myIntArray"`
	MyStringArray    []string         `json:"myStringArray"`
	MyMap            map[string]int32 `json:"myMap"`
	MyUuid           rdl.UUID         `json:"myUuid"`
	MyStringSubtype  azAZ             `json:"myStringSubtype"`
	MyInt32Subtype   Year             `json:"myInt32Subtype"`
	MyFloat64Subtype Pi               `json:"myFloat64Subtype"`
	MyTime           rdl.Timestamp    `json:"myTime"`
}

BigStruct -

func NewBigStruct

func NewBigStruct(init ...*BigStruct) *BigStruct

NewBigStruct - creates an initialized BigStruct instance, returns a pointer to it

func (*BigStruct) Init

func (pTypeDef *BigStruct) Init() *BigStruct

Init - sets up the instance according to its default field values, if any

func (*BigStruct) UnmarshalJSON

func (pTypeDef *BigStruct) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a BigStruct

func (*BigStruct) Validate

func (pTypeDef *BigStruct) Validate() error

Validate - checks for missing required fields, etc

type BigTest

type BigTest struct {
	Stuff []*BigStruct `json:"stuff"`
}

BigTest -

func NewBigTest

func NewBigTest(init ...*BigTest) *BigTest

NewBigTest - creates an initialized BigTest instance, returns a pointer to it

func (*BigTest) Init

func (pTypeDef *BigTest) Init() *BigTest

Init - sets up the instance according to its default field values, if any

func (*BigTest) UnmarshalJSON

func (pTypeDef *BigTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a BigTest

func (*BigTest) Validate

func (pTypeDef *BigTest) Validate() error

Validate - checks for missing required fields, etc

type ComplicatedOptions

type ComplicatedOptions string

ComplicatedOptions -

type CompoundName

type CompoundName string

CompoundName -

type Decoder

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

Decoder - the state for the decoder

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder - create and return a new Encoder. This is a "session" for tbin, i.e. accumulated state for this encoder can make repeated Marshal calls more efficient.

func (*Decoder) BoolValue

func (d *Decoder) BoolValue() bool

func (*Decoder) CurrentCount

func (d *Decoder) CurrentCount() int

func (*Decoder) Decode

func (d *Decoder) Decode(data interface{}) error

func (*Decoder) DecodeArray

func (d *Decoder) DecodeArray() ([]interface{}, error)

func (*Decoder) DecodeArrayReflect

func (d *Decoder) DecodeArrayReflect(v reflect.Value) error

func (*Decoder) DecodeMap

func (d *Decoder) DecodeMap() (map[string]interface{}, error)

func (*Decoder) DecodeMapReflect

func (d *Decoder) DecodeMapReflect(v reflect.Value) error

func (*Decoder) DecodeReflect

func (d *Decoder) DecodeReflect(v reflect.Value) error

func (*Decoder) DecodeStruct

func (d *Decoder) DecodeStruct() (map[string]interface{}, error)

func (*Decoder) DecodeStructReflect

func (d *Decoder) DecodeStructReflect(v reflect.Value) error

func (*Decoder) Error

func (d *Decoder) Error() error

func (*Decoder) Int16Value

func (d *Decoder) Int16Value() int16

func (*Decoder) Int32Value

func (d *Decoder) Int32Value() int32

func (*Decoder) Int64Value

func (d *Decoder) Int64Value() int64

func (*Decoder) Int8Value

func (d *Decoder) Int8Value() int8

func (*Decoder) ParseBool

func (d *Decoder) ParseBool() bool

func (*Decoder) ParseBytes

func (d *Decoder) ParseBytes() ([]byte, error)

func (*Decoder) ParseFloat32

func (d *Decoder) ParseFloat32() (float32, error)

func (*Decoder) ParseFloat64

func (d *Decoder) ParseFloat64() (float64, error)

func (*Decoder) ParseInt

func (d *Decoder) ParseInt() int

func (*Decoder) ParseInt64

func (d *Decoder) ParseInt64() int64

func (*Decoder) ParseString

func (d *Decoder) ParseString() (string, error)

func (*Decoder) ParseSymbol

func (d *Decoder) ParseSymbol() (string, error)

func (*Decoder) ParseTimestamp

func (d *Decoder) ParseTimestamp() (rdl.Timestamp, error)

func (*Decoder) ParseUUID

func (d *Decoder) ParseUUID() (rdl.UUID, error)

func (*Decoder) ParseUnsigned

func (d *Decoder) ParseUnsigned() uint

func (*Decoder) ParseUnsigned64

func (d *Decoder) ParseUnsigned64() uint64

func (*Decoder) ReadInt

func (d *Decoder) ReadInt() int

func (*Decoder) ReadInt32

func (d *Decoder) ReadInt32() int32

func (*Decoder) ReadSize

func (d *Decoder) ReadSize() int

func (*Decoder) ReadType

func (d *Decoder) ReadType() (*Signature, error)

func (*Decoder) ReadUnsigned

func (d *Decoder) ReadUnsigned() int

type Drawing

type Drawing struct {
	Shapes []*Shape `json:"shapes"`
}

Drawing -

func NewDrawing

func NewDrawing(init ...*Drawing) *Drawing

NewDrawing - creates an initialized Drawing instance, returns a pointer to it

func (*Drawing) Init

func (pTypeDef *Drawing) Init() *Drawing

Init - sets up the instance according to its default field values, if any

func (*Drawing) UnmarshalJSON

func (pTypeDef *Drawing) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a Drawing

func (*Drawing) Validate

func (pTypeDef *Drawing) Validate() error

Validate - checks for missing required fields, etc

type Encoder

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

Encoder - the state for the encoder.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder - create and return a new Encoder. This is a "session" for tbin, i.e. accumulated state for this encoder can make repeated Marshal calls more efficient.

func (*Encoder) Bytes

func (enc *Encoder) Bytes() []byte

Bytes - return the encoded data as a byte array

func (*Encoder) Encode

func (enc *Encoder) Encode(data interface{}) error

Encode - this encoder method marshals an arbitrary object. It first checks of the object implements the TBinMarshallable interface, and if so calls the objects Marshal method. Otherwise, it uses reflection on the object to determine how to marshal it.

func (*Encoder) EncodeArray

func (enc *Encoder) EncodeArray(val []interface{}, useMarshallable bool) error

func (*Encoder) EncodeBool

func (enc *Encoder) EncodeBool(val bool) error

func (*Encoder) EncodeBytes

func (enc *Encoder) EncodeBytes(val []byte) error

func (*Encoder) EncodeFloat32

func (enc *Encoder) EncodeFloat32(val float32) error

func (*Encoder) EncodeFloat64

func (enc *Encoder) EncodeFloat64(val float64) error

func (*Encoder) EncodeInt16

func (enc *Encoder) EncodeInt16(val int16) error

func (*Encoder) EncodeInt32

func (enc *Encoder) EncodeInt32(val int32) error

func (*Encoder) EncodeInt64

func (enc *Encoder) EncodeInt64(val int64) error

func (*Encoder) EncodeInt8

func (enc *Encoder) EncodeInt8(val int8) error

func (*Encoder) EncodeNull

func (enc *Encoder) EncodeNull() error

func (*Encoder) EncodeReflect

func (enc *Encoder) EncodeReflect(data interface{}) error

EncodeReflect - encode the data *without* using any TbinMarshallable support, relying solely on reflection

func (*Encoder) EncodeString

func (enc *Encoder) EncodeString(val string) error

func (*Encoder) EncodeStruct

func (enc *Encoder) EncodeStruct(val rdl.Struct, useMarshallable bool) error

func (*Encoder) EncodeSymbol

func (enc *Encoder) EncodeSymbol(val rdl.Symbol) error

func (*Encoder) EncodeTimestamp

func (enc *Encoder) EncodeTimestamp(val rdl.Timestamp) error

func (*Encoder) EncodeUUID

func (enc *Encoder) EncodeUUID(val rdl.UUID) error

func (*Encoder) Error

func (enc *Encoder) Error() error

Return the last encoding error, if any.

func (*Encoder) Flush

func (enc *Encoder) Flush() error

Flush - flush output, and reset buffer to encode again

func (*Encoder) WriteBool

func (enc *Encoder) WriteBool(val bool) error

WriteBool - writes the value of the bool

func (*Encoder) WriteBytes

func (enc *Encoder) WriteBytes(b []byte) error

func (*Encoder) WriteFloat32

func (enc *Encoder) WriteFloat32(n float32) error

WriteFloat32 - writes the signed 32 bit float as a varint

func (*Encoder) WriteFloat64

func (enc *Encoder) WriteFloat64(n float64) error

WriteFloat64 - writes the signed 64 bit float as a varint

func (*Encoder) WriteInt

func (enc *Encoder) WriteInt(n int) error

WriteInt - write the signed 32 bit int

func (*Encoder) WriteInt16

func (enc *Encoder) WriteInt16(val int16) error

WriteInt16 - writes the signed 16 bit integer as a varint

func (*Encoder) WriteInt32

func (enc *Encoder) WriteInt32(val int32) error

WriteInt32 - writes the signed 32 bit integer as a varint

func (*Encoder) WriteInt64

func (enc *Encoder) WriteInt64(nn int64) error

WriteInt64 - writes the signed 64 bit integer as a varint

func (*Encoder) WriteInt8

func (enc *Encoder) WriteInt8(val int8) error

WriteInt8 - writes the signed 8 bit integer as a varint

func (*Encoder) WriteSize

func (enc *Encoder) WriteSize(val int) error

func (*Encoder) WriteString

func (enc *Encoder) WriteString(s string) error

func (*Encoder) WriteSymbol

func (enc *Encoder) WriteSymbol(name string) error

func (*Encoder) WriteTag

func (enc *Encoder) WriteTag(val int) error

func (*Encoder) WriteTimestamp

func (enc *Encoder) WriteTimestamp(val rdl.Timestamp) error

func (*Encoder) WriteType

func (enc *Encoder) WriteType(sig *Signature) error

WriteType takes a signature and writes the tag for it. If it is the first time the signature has been encountered, a new tag is allocated and written followed by its definition.

func (*Encoder) WriteUUID

func (enc *Encoder) WriteUUID(u rdl.UUID) error

func (*Encoder) WriteUnsigned

func (enc *Encoder) WriteUnsigned(val int) error

WriteUnsigned - writes the int as a varuint. The argument is signed instead of unsigned because typical use cases (i.e. len(slice), or 0x40) themselves use int. An error is returned it the value is negative.

type FieldSignature

type FieldSignature struct {
	Name string     `json:"name"`
	Type *Signature `json:"type"`
	// contains filtered or unexported fields
}

FieldSignature is the description of a single field in a Struct.

func Field

func Field(n string, t *Signature, opt bool) *FieldSignature

type IntOOBTest

type IntOOBTest struct {
	Theyear Year `json:"theyear"`
}

IntOOBTest -

func NewIntOOBTest

func NewIntOOBTest(init ...*IntOOBTest) *IntOOBTest

NewIntOOBTest - creates an initialized IntOOBTest instance, returns a pointer to it

func (*IntOOBTest) UnmarshalJSON

func (pTypeDef *IntOOBTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a IntOOBTest

func (*IntOOBTest) Validate

func (pTypeDef *IntOOBTest) Validate() error

Validate - checks for missing required fields, etc

type LargeInt

type LargeInt int64

LargeInt -

type Latitude

type Latitude float64

Latitude -

type LongNumber

type LongNumber int64

LongNumber -

type MapArrayTest

type MapArrayTest struct {
	Locations map[string]ArrayOfInt `json:"locations"`
}

MapArrayTest -

func NewMapArrayTest

func NewMapArrayTest(init ...*MapArrayTest) *MapArrayTest

NewMapArrayTest - creates an initialized MapArrayTest instance, returns a pointer to it

func (*MapArrayTest) Init

func (pTypeDef *MapArrayTest) Init() *MapArrayTest

Init - sets up the instance according to its default field values, if any

func (*MapArrayTest) UnmarshalJSON

func (pTypeDef *MapArrayTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a MapArrayTest

func (*MapArrayTest) Validate

func (pTypeDef *MapArrayTest) Validate() error

Validate - checks for missing required fields, etc

type MapTest

type MapTest struct {
	Locations map[string]int32 `json:"locations"`
}

MapTest -

func NewMapTest

func NewMapTest(init ...*MapTest) *MapTest

NewMapTest - creates an initialized MapTest instance, returns a pointer to it

func (*MapTest) Init

func (pTypeDef *MapTest) Init() *MapTest

Init - sets up the instance according to its default field values, if any

func (*MapTest) UnmarshalJSON

func (pTypeDef *MapTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a MapTest

func (*MapTest) Validate

func (pTypeDef *MapTest) Validate() error

Validate - checks for missing required fields, etc

type NegativeNumberTest

type NegativeNumberTest struct {
	Mylatitude Latitude `json:"mylatitude"`
}

NegativeNumberTest -

func NewNegativeNumberTest

func NewNegativeNumberTest(init ...*NegativeNumberTest) *NegativeNumberTest

NewNegativeNumberTest - creates an initialized NegativeNumberTest instance, returns a pointer to it

func (*NegativeNumberTest) UnmarshalJSON

func (pTypeDef *NegativeNumberTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a NegativeNumberTest

func (*NegativeNumberTest) Validate

func (pTypeDef *NegativeNumberTest) Validate() error

Validate - checks for missing required fields, etc

type Options

type Options int

Options - options comment

const (
	ONE Options
	TWO
	THREE
)

Options constants

func NewOptions

func NewOptions(init ...interface{}) Options

NewOptions - return a string representation of the enum

func (Options) MarshalJSON

func (e Options) MarshalJSON() ([]byte, error)

MarshalJSON is defined for proper JSON encoding of a Options

func (Options) String

func (e Options) String() string

String - return a string representation of the enum

func (*Options) UnmarshalJSON

func (e *Options) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a Options

type Pi

type Pi float64

Pi -

type Point

type Point struct {
	X int32 `json:"x"`
	Y int32 `json:"y"`
}

Point -

func NewPoint

func NewPoint(init ...*Point) *Point

NewPoint - creates an initialized Point instance, returns a pointer to it

func (*Point) UnmarshalJSON

func (pTypeDef *Point) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a Point

func (*Point) Validate

func (pTypeDef *Point) Validate() error

Validate - checks for missing required fields, etc

type Polyline

type Polyline struct {
	Points []*Point `json:"points"`
}

Polyline -

func NewPolyline

func NewPolyline(init ...*Polyline) *Polyline

NewPolyline - creates an initialized Polyline instance, returns a pointer to it

func (*Polyline) Init

func (pTypeDef *Polyline) Init() *Polyline

Init - sets up the instance according to its default field values, if any

func (Polyline) String

func (line Polyline) String() string

func (*Polyline) UnmarshalJSON

func (pTypeDef *Polyline) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a Polyline

func (*Polyline) Validate

func (pTypeDef *Polyline) Validate() error

Validate - checks for missing required fields, etc

type Rect

type Rect struct {
	P1 *Point `json:"p1"`
	P2 *Point `json:"p2"`
}

Rect -

func NewRect

func NewRect(init ...*Rect) *Rect

NewRect - creates an initialized Rect instance, returns a pointer to it

func (*Rect) Init

func (pTypeDef *Rect) Init() *Rect

Init - sets up the instance according to its default field values, if any

func (*Rect) UnmarshalJSON

func (pTypeDef *Rect) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a Rect

func (*Rect) Validate

func (pTypeDef *Rect) Validate() error

Validate - checks for missing required fields, etc

type RegularInt

type RegularInt int32

RegularInt -

type Shape

type Shape struct {
	Variant  ShapeVariantTag `rdl:"union"`
	Polyline *Polyline
	Rect     *Rect
}

Shape -

func (Shape) MarshalJSON

func (u Shape) MarshalJSON() ([]byte, error)

MarshalJSON for Shape

func (Shape) String

func (u Shape) String() string

func (*Shape) UnmarshalJSON

func (u *Shape) UnmarshalJSON(b []byte) error

UnmarshalJSON for Shape

type ShapeVariantTag

type ShapeVariantTag int

ShapeVariantTag - generated to support Shape

const (
	ShapeVariantPolyline ShapeVariantTag
	ShapeVariantRect
)

Supporting constants

type Signature

type Signature struct {
	Tag      int               `json:"tag"`
	Fields   []*FieldSignature `json:"fields,omitempty"`
	Items    *Signature        `json:"items,omitempty"`
	Keys     *Signature        `json:"keys,omitempty"`
	Variants []*Signature      `json:"variants,omitempty"`
	Symbols  []string          `json:"symbols,omitempty"`
	// contains filtered or unexported fields
}

Signature is a minimal description of a type.

func Array

func Array(items *Signature) *Signature

func Enum

func Enum(symbols ...string) *Signature

func Map

func Map(keys *Signature, items *Signature) *Signature

func Struct

func Struct(fields ...*FieldSignature) *Signature

func TypeSignature

func TypeSignature(val interface{}) *Signature

TypeSignature returns a Signature for the type of the given data. Reflection is used.

func Union

func Union(variants ...*Signature) *Signature

func (*Signature) String

func (sig *Signature) String() string

String produces a compact flat representation of the signature.

type SimpleName

type SimpleName string

SimpleName -

type SmallInt

type SmallInt int16

SmallInt -

type StringTest

type StringTest struct {
	Name   SimpleName   `json:"name"`
	Parent CompoundName `json:"parent"`
	Names  []SimpleName `json:"names,omitempty" rdl:"optional"`
	Enc    YEncoded     `json:"enc,omitempty" rdl:"optional"`
}

StringTest -

func NewStringTest

func NewStringTest(init ...*StringTest) *StringTest

NewStringTest - creates an initialized StringTest instance, returns a pointer to it

func (*StringTest) UnmarshalJSON

func (pTypeDef *StringTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a StringTest

func (*StringTest) Validate

func (pTypeDef *StringTest) Validate() error

Validate - checks for missing required fields, etc

type Symbolic

type Symbolic interface {
	Symbol() string
}

Symbolic is an interface wrapping the Symbol() method.

type TBinMarshallable

type TBinMarshallable interface {
	MarshalTBin(*Encoder) error
}

TBinMarshallable - if an object implements this interface, it is used to marshal objects to TBin. This is optional, a default reflection-based encoder will be used for structs that do not implement this.

type TBinUnmarshallable

type TBinUnmarshallable interface {
	UnmarshalTBin(dec *Decoder) error
}

TBinUnmarshallable - implement this interface to take control of decoding.

type TimestampTest

type TimestampTest struct {
	Mytime rdl.Timestamp `json:"mytime"`
}

TimestampTest -

func NewTimestampTest

func NewTimestampTest(init ...*TimestampTest) *TimestampTest

NewTimestampTest - creates an initialized TimestampTest instance, returns a pointer to it

func (*TimestampTest) UnmarshalJSON

func (pTypeDef *TimestampTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a TimestampTest

func (*TimestampTest) Validate

func (pTypeDef *TimestampTest) Validate() error

Validate - checks for missing required fields, etc

type TinyInt

type TinyInt int8

TinyInt -

type UUIDTest

type UUIDTest struct {
	Myid rdl.UUID `json:"myid"`
}

UUIDTest -

func NewUUIDTest

func NewUUIDTest(init ...*UUIDTest) *UUIDTest

NewUUIDTest - creates an initialized UUIDTest instance, returns a pointer to it

func (*UUIDTest) UnmarshalJSON

func (pTypeDef *UUIDTest) UnmarshalJSON(b []byte) error

UnmarshalJSON is defined for proper JSON decoding of a UUIDTest

func (*UUIDTest) Validate

func (pTypeDef *UUIDTest) Validate() error

Validate - checks for missing required fields, etc

type YEncoded

type YEncoded string

YEncoded -

type Year

type Year int32

Year -

Jump to

Keyboard shortcuts

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