Documentation
¶
Index ¶
- Constants
- type AliasContainer
- type ArrayConstants
- type Block
- type ConvertErr
- type ConvertErrVal
- type ConvertIntf
- type ConvertIntfVal
- type ConvertString
- type ConvertStringMapValue
- type ConvertStringSlice
- type ConvertStringVal
- type Custom
- type CustomBytes
- type CustomInt
- type Embedded
- type EmptyStruct
- type EmptyStructMapUsesTuple
- type EmptyStructNested
- type EmptyStructTuple
- type EmptyStructTupleNested
- type EmptyStructTupleUsesMap
- type EmptyStructTupleUsesTuple
- type EmptyStructUses
- type FastAlias
- type FileHandle
- type Files
- type Fixed
- type Insane
- type Int32ForUint16Dec
- type IntA
- type IntB
- type IntC
- type MixedIntsDec
- type MixedIntsEnc
- type MyEnum
- type NoFields
- type NonMsgStructTags
- type Object
- type SpecialID
- type T
- type TestBench
- type TestFast
- type TestHidden
- type TestObj
- type TestType
- type Things
- type Tree
- type Uint16Enc
- type Wrapper
- type X
Constants ¶
const ( ConstantInt int = 8 ConstantInt8 int8 = 8 ConstantInt16 int16 = 8 ConstantInt32 int32 = 8 ConstantInt64 int64 = 8 ConstantUint uint = 8 ConstantUint8 uint8 = 8 ConstantUint16 uint16 = 8 ConstantUint32 uint32 = 8 ConstantUint64 uint64 = 8 )
Ensure all different widths of integer can be used as constant keys.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasContainer ¶
type AliasContainer struct {
Fast FastAlias
}
type ArrayConstants ¶
type ArrayConstants struct {
ConstantInt [ConstantInt]string
ConstantInt8 [ConstantInt8]string
ConstantInt16 [ConstantInt16]string
ConstantInt32 [ConstantInt32]string
ConstantInt64 [ConstantInt64]string
ConstantUint [ConstantUint]string
ConstantUint8 [ConstantUint8]string
ConstantUint16 [ConstantUint16]string
ConstantUint32 [ConstantUint32]string
ConstantUint64 [ConstantUint64]string
ConstantHex [0x16]string
ConstantOctal [07]string
}
type ConvertErr ¶
type ConvertErr struct {
Err ConvertErrVal
}
type ConvertErrVal ¶
type ConvertErrVal string
type ConvertIntf ¶
type ConvertIntf struct {
Intf ConvertIntfVal
}
type ConvertIntfVal ¶
type ConvertIntfVal struct {
Test string
}
type ConvertString ¶
type ConvertString struct {
String ConvertStringVal
}
type ConvertStringMapValue ¶
type ConvertStringMapValue struct {
Strings map[string]ConvertStringVal
}
type ConvertStringSlice ¶
type ConvertStringSlice struct {
Strings []ConvertStringVal
}
type ConvertStringVal ¶
type ConvertStringVal string
type Custom ¶
type Custom struct {
Bts CustomBytes `msgp:"bts"`
Mp map[string]*Embedded `msgp:"mp"`
Enums []MyEnum `msgp:"enums"` // test explicit enum shim
Some FileHandle `msgp:"file_handle"`
}
type CustomBytes ¶
type CustomBytes []byte
type EmptyStruct ¶
type EmptyStruct struct{}
type EmptyStructMapUsesTuple ¶
type EmptyStructMapUsesTuple struct {
Nested EmptyStructTuple
NestedPtr *EmptyStructTuple
}
type EmptyStructNested ¶
type EmptyStructTuple ¶
type EmptyStructTuple struct{}
type EmptyStructTupleNested ¶
type EmptyStructTupleUsesMap ¶
type EmptyStructTupleUsesMap struct {
Nested EmptyStruct
NestedPtr *EmptyStruct
}
type EmptyStructTupleUsesTuple ¶
type EmptyStructTupleUsesTuple struct {
Nested EmptyStructTuple
NestedPtr *EmptyStructTuple
}
type EmptyStructUses ¶
type EmptyStructUses struct {
Nested EmptyStruct
NestedPtr *EmptyStruct
}
type FileHandle ¶
type Int32ForUint16Dec ¶
type Int32ForUint16Dec int32
Int32ForUint16Dec values should be decodable from the encoded Uint16Enc type.
type MixedIntsDec ¶
type MixedIntsDec struct {
A int64 // Keeping same as above (like in real world).
B int8
C int32
D int64
}
MixedIntsDec values should be decodable from the encoded MixedIntsEnc type.
type MixedIntsEnc ¶
MixedIntsEnc values should be decodable into a MixedInts1dec (if no integers overflow or are negative).
type NoFields ¶
The NoFields type gets methods generated, but it does not have any fields that can get encoded/decoded with MessagePack.
This tests whether a "field" variable declaration is made in unmarshal or decode methods for a struct with no encodable/decodable fields. If an unused "field" variable is declared, the code will not compile.
type NonMsgStructTags ¶
type TestHidden ¶
type TestType ¶
type TestType struct {
F *float64 `msgp:"float"`
Els map[string]string `msgp:"elements"`
Obj struct {
ValueA string `msgp:"value_a"`
ValueB []byte `msgp:"value_b"`
} `msgp:"object"`
Child *TestType `msgp:"child"`
Time time.Time `msgp:"time"`
Any interface{} `msgp:"any"`
Appended msgp.Raw `msgp:"appended"`
Num msgp.Number `msgp:"num"`
Byte byte
Rune rune
RunePtr *rune
RunePtrPtr **rune
RuneSlice []rune
Slice1 []string
Slice2 []string
SlicePtr *[]string
}
type Things ¶
type Things struct {
Cmplx complex64 `msgp:"complex"` // test slices
Vals []int32 `msgp:"values"`
Arr [msgp.ExtensionPrefixSize]float64 `msgp:"arr"` // test const array and *ast.SelectorExpr as array size
Arr2 [4]float64 `msgp:"arr2"` // test basic lit array
Ext *msgp.RawExtension `msgp:"ext,extension"` // test extension
Oext msgp.RawExtension `msgp:"oext,extension"` // test extension reference
}
type Uint16Enc ¶
type Uint16Enc uint16
Uint16Enc values should be decodable into a Int32ForUint16Dec (if no integers overflow or are negative).
type X ¶
type X struct {
Values [32]byte // should compile to 32*msgp.ByteSize; encoded as Bin
ValuesPtr *[32]byte // check (*)[:] deref
More Block // should be identical to the above
Others [][32]int32 // should compile to len(x.Others)*32*msgp.Int32Size
Matrix [][]int32 // should not optimize
ManyFixed []Fixed
}
Test edge-cases with compiling size compilation.