Documentation ¶
Index ¶
- type AliasContainer
- type Block
- type Bunny
- type Custom
- type CustomBytes
- type CustomInt
- type Embedded
- type FastAlias
- type FileHandle
- type Files
- type Fixed
- type Greeter
- type Hello
- type Insane
- type InsaneInner
- type IntA
- type IntB
- type IntC
- type Moose
- type MyEnum
- type NeedsDedup
- type Object
- type OmitEmptyInside1
- type OmitEmptyInside2
- type OmitSimple
- type PreviouslyAnon
- type Rocky
- type SimpleTestType
- type SpecialID
- type T
- type Target
- type TestBench
- type TestFast
- type TestHidden
- type TestObj
- type TestOmitEmpty
- type TestType
- type Things
- type TopNester
- type Tree
- type Wrapper
- type X
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasContainer ¶
type AliasContainer struct {
Fast FastAlias
}
type Custom ¶
type Custom struct { Bts CustomBytes `msg:"bts"` Mp map[string]*Embedded `msg:"mp"` Enums []MyEnum `msg:"enums"` // test explicit enum shim Some FileHandle `msg:file_handle` }
type CustomBytes ¶
type CustomBytes []byte
type FileHandle ¶
type Insane ¶
type Insane [3]map[string]InsaneInner
anonymous structs can't be serialized with greenpack, because the fieldsempty/everything omitempty by default logic requires named types when we define the helper method fieldsNotEmpty().
type InsaneInner ¶ added in v0.360.0
type InsaneInner struct{ A, B CustomInt }
type NeedsDedup ¶ added in v0.500.0
type NeedsDedup struct { MyPtr0 *Target MyPtr1 *Target MyIface0 Hello `msg:",iface"` MyIface1 Hello `msg:",iface"` Slice []Hello `msg:",iface"` SlicePtr []*Greeter }
func (*NeedsDedup) NewValueAsInterface ¶ added in v0.500.0
func (nd *NeedsDedup) NewValueAsInterface(zid int64, typename string) interface{}
type OmitEmptyInside1 ¶ added in v0.120.0
type OmitEmptyInside1 struct { CountOfMonteCrisco int Name string `msg:"name,omitempty"` Inside2 OmitEmptyInside2 `msg:",omitempty"` }
type OmitEmptyInside2 ¶ added in v0.120.0
type OmitEmptyInside2 struct {
NameSuey string `msg:",omitempty"`
}
type OmitSimple ¶ added in v0.120.0
type OmitSimple struct { CountDrocula int Inside1 OmitEmptyInside1 `msg:",omitempty"` }
type PreviouslyAnon ¶ added in v0.360.0
type SimpleTestType ¶ added in v0.360.0
type SimpleTestType struct { F *float64 `msg:"float"` Els map[string]string `msg:"elements"` Obj *PreviouslyAnon `msg:"object"` }
type TestHidden ¶
type TestOmitEmpty ¶ added in v0.120.0
type TestOmitEmpty struct { // scalars Name string `msg:",omitempty"` BirthDay time.Time `msg:",omitempty"` Phone string `msg:",omitempty"` Siblings int `msg:",omitempty"` Spouse bool `msg:",omitempty"` Money float64 `msg:",omitempty"` // slices SliceName []string `msg:",omitempty"` SliceBirthDay []time.Time `msg:",omitempty"` SlicePhone []string `msg:",omitempty"` SliceSiblings []int `msg:",omitempty"` SliceSpouse []bool `msg:",omitempty"` SliceMoney []float64 `msg:",omitempty"` // arrays ArrayName [3]string `msg:",omitempty"` ArrayBirthDay [3]time.Time `msg:",omitempty"` ArrayPhone [3]string `msg:",omitempty"` ArraySiblings [3]int `msg:",omitempty"` ArraySpouse [3]bool `msg:",omitempty"` ArrayMoney [3]float64 `msg:",omitempty"` // maps MapStringString map[string]string `msg:",omitempty"` MapStringIface map[string]interface{} `msg:",omitempty"` // pointers PtrName *string `msg:",omitempty"` PtrBirthDay *time.Time `msg:",omitempty"` PtrPhone *string `msg:",omitempty"` PtrSiblings *int `msg:",omitempty"` PtrSpouse *bool `msg:",omitempty"` PtrMoney *float64 `msg:",omitempty"` Inside1 OmitEmptyInside1 `msg:",omitempty"` Greetings string `msg:",omitempty"` Bullwinkle *Rocky `msg:",omitempty"` }
Test omitempty tag
type TestType ¶
type TestType struct { F *float64 `msg:"float"` Els map[string]string `msg:"elements"` Obj PreviouslyAnon `msg:"object"` Child *TestType `msg:"child"` Time time.Time `msg:"time"` Any interface{} `msg:"any"` Appended msgp.Raw `msg:"appended"` Num msgp.Number `msg:"num"` Slice1 []string Slice2 []string SlicePtr *[]string }
type Things ¶
type Things struct { Cmplx complex64 `msg:"complex"` // test slices Vals []int32 `msg:"values"` //Arr [msgp.ExtensionPrefixSize]float64 `msg:"arr"` // test const array and *ast.SelectorExpr as array size Arr [6]float64 `msg:"arr"` // test const array and *ast.SelectorExpr as array size Arr2 [4]float64 `msg:"arr2"` // test basic lit array Ext *msgp.RawExtension `msg:"ext,extension"` // test extension Oext msgp.RawExtension `msg:"oext,extension"` // test extension reference }
type TopNester ¶ added in v0.120.0
type TopNester struct { TopId int Greetings string `msg:",omitempty"` Bullwinkle *Rocky `msg:",omitempty"` MyIntArray [3]int `msg:",omitempty"` MyByteArray [3]byte `msg:",omitempty"` MyMap map[string]string `msg:",omitempty"` MyArrayMap [3]map[string]string `msg:",omitempty"` // the time.Time extension TopTime time.Time `msg:",omitempty"` PtrTime *time.Time `msg:",omitempty"` }
type X ¶
type X struct { Values [32]byte // should compile to 32*msgp.ByteSize; encoded as Bin 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 }
tests edge-cases with compiling size compilation.
Click to show internal directories.
Click to hide internal directories.