Documentation
¶
Overview ¶
Package gen tests all field mapping options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ColferSizeMax is the upper limit for serial byte sizes. ColferSizeMax = 16 * 1024 * 1024 // ColferListMax is the upper limit for the number of elements in a list. ColferListMax = 64 * 1024 )
Colfer configuration attributes
Functions ¶
This section is empty.
Types ¶
type O ¶
type O struct {
// B tests booleans.
B bool
// U32 tests unsigned 32-bit integers.
U32 uint32
// U64 tests unsigned 64-bit integers.
U64 uint64
// I32 tests signed 32-bit integers.
I32 int32
// I64 tests signed 64-bit integers.
I64 int64
// F32 tests 32-bit floating points.
F32 float32
// F64 tests 64-bit floating points.
F64 float64
// T tests timestamps.
T time.Time
// S tests text.
S string
// A tests binaries.
A []byte
// O tests nested data structures.
O *O
// Os tests data structure lists.
Os []*O
// Ss tests text lists.
Ss []string
// As tests binary lists.
As [][]byte
// U8 tests unsigned 8-bit integers.
U8 uint8
// U16 tests unsigned 16-bit integers.
U16 uint16
// F32s tests 32-bit floating point lists.
F32s []float32
// F64s tests 64-bit floating point lists.
F64s []float64
}
O contains all supported data types.
func (*O) MarshalBinary ¶
MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Os will be replaced with a new value. The error return option is gen.ColferMax.
func (*O) MarshalLen ¶
MarshalLen returns the Colfer serial byte size. The error return option is gen.ColferMax.
func (*O) MarshalTo ¶
MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Os will be replaced with a new value.
func (*O) Unmarshal ¶
Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, gen.ColferError and gen.ColferMax.
func (*O) UnmarshalBinary ¶
UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, gen.ColferError, gen.ColferTail and gen.ColferMax.