Documentation ¶
Index ¶
- type AliasContainer
- type Block
- type Bunny
- type Commit
- type Custom
- type CustomBytes
- type CustomInt
- type Embedded
- type Event
- type FastAlias
- type FileHandle
- type Files
- type Fixed
- type Greeter
- type Greeter2
- func (z *Greeter2) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Greeter2) EncodeMsg(en *msgp.Writer) (err error)
- func (t *Greeter2) Hi()
- func (z Greeter2) MarshalMsg(b []byte) (o []byte, err error)
- func (z Greeter2) Msgsize() (s int)
- func (z *Greeter2) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Greeter2) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- type Hello
- type Hello2
- type Imid
- type Imid2
- type Inner
- type Inner2
- func (z *Inner2) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Inner2) EncodeMsg(en *msgp.Writer) (err error)
- func (z Inner2) MarshalMsg(b []byte) (o []byte, err error)
- func (z Inner2) Msgsize() (s int)
- func (in *Inner2) Shout()
- func (z *Inner2) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Inner2) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- type Insane
- type InsaneInner
- type IntA
- type IntB
- type IntC
- type Middle
- type Middle2
- func (z *Middle2) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Middle2) EncodeMsg(en *msgp.Writer) (err error)
- func (z *Middle2) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Middle2) Msgsize() (s int)
- func (nd *Middle2) NewValueAsInterface(zid int64, typename string) interface{}
- func (z *Middle2) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Middle2) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- func (s *Middle2) Yowza()
- type Moose
- type MyEnum
- type NeedsDedup
- type NoDedup
- func (z *NoDedup) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *NoDedup) EncodeMsg(en *msgp.Writer) (err error)
- func (z *NoDedup) MarshalMsg(b []byte) (o []byte, err error)
- func (z *NoDedup) Msgsize() (s int)
- func (nd *NoDedup) NewValueAsInterface(zid int64, typename string) interface{}
- func (z *NoDedup) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *NoDedup) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- type Object
- type OmitEmptyInside1
- type OmitEmptyInside2
- type OmitSimple
- type Outer
- type Outer2
- func (z *Outer2) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Outer2) EncodeMsg(en *msgp.Writer) (err error)
- func (z *Outer2) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Outer2) Msgsize() (s int)
- func (nd *Outer2) NewValueAsInterface(zid int64, typename string) interface{}
- func (z *Outer2) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Outer2) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- type PreviouslyAnon
- type Rocky
- type Shouter
- type Shouter2
- type SimpleTestType
- type SpecialID
- type T
- type Target
- type Target2
- func (z *Target2) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Target2) EncodeMsg(en *msgp.Writer) (err error)
- func (z Target2) MarshalMsg(b []byte) (o []byte, err error)
- func (z Target2) Msgsize() (s int)
- func (z *Target2) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Target2) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)
- type TestBench
- type TestFast
- type TestHidden
- type TestObj
- type TestOmitEmpty
- type TestType
- type Things
- type TopNester
- type Tree
- type Wrapper
- type X
- type ZError
- type ZResponse
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 Event ¶ added in v0.506.0
type Event struct { ID []byte `zid:"0",msg:"id"` AggregateID []byte `zid:"1",msg:"aggregate_id"` Type string `zid:"2",msg:"type"` Time time.Time `zid:"3",msg:"time"` }
greenpack Issue 6: must be big enough to *NOT* inline.
type FileHandle ¶
type Greeter2 ¶ added in v0.505.0
type Greeter2 struct {
Style int
}
func (*Greeter2) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (Greeter2) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (Greeter2) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Greeter2) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Greeter2) UnmarshalMsgWithCfg ¶ added in v0.505.0
type Inner2 ¶ added in v0.505.0
type Inner2 struct {
Bubbles int
}
func (*Inner2) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (Inner2) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (Inner2) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Inner2) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Inner2) UnmarshalMsgWithCfg ¶ added in v0.505.0
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 Middle ¶ added in v0.503.0
type Middle struct {
Children []Shouter `msg:",iface"`
}
func (*Middle) NewValueAsInterface ¶ added in v0.503.0
type Middle2 ¶ added in v0.505.0
type Middle2 struct {
Children []Shouter2 `msg:",iface"`
}
func (*Middle2) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (*Middle2) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (*Middle2) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Middle2) NewValueAsInterface ¶ added in v0.505.0
func (*Middle2) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Middle2) UnmarshalMsgWithCfg ¶ added in v0.505.0
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 NoDedup ¶ added in v0.505.0
type NoDedup struct { MyPtr0 *Target2 MyPtr1 *Target2 MyIface0 Hello2 `msg:",iface"` MyIface1 Hello2 `msg:",iface"` Slice []Hello2 `msg:",iface"` SlicePtr []*Greeter2 }
func (*NoDedup) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (*NoDedup) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (*NoDedup) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*NoDedup) NewValueAsInterface ¶ added in v0.505.0
func (*NoDedup) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*NoDedup) UnmarshalMsgWithCfg ¶ added in v0.505.0
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 Outer ¶ added in v0.503.0
type Outer struct {
Slc []Imid `msg:"slc,iface" json:"slc" zid:"0"`
}
func (*Outer) NewValueAsInterface ¶ added in v0.503.0
type Outer2 ¶ added in v0.505.0
type Outer2 struct {
Slc []Imid2 `msg:"slc,iface" json:"slc" zid:"0"`
}
func (*Outer2) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (*Outer2) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (*Outer2) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Outer2) NewValueAsInterface ¶ added in v0.505.0
func (*Outer2) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Outer2) UnmarshalMsgWithCfg ¶ added in v0.505.0
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 Target2 ¶ added in v0.505.0
type Target2 struct {
ID int
}
func (*Target2) DecodeMsg ¶ added in v0.505.0
DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.
func (Target2) MarshalMsg ¶ added in v0.505.0
MarshalMsg implements msgp.Marshaler
func (Target2) Msgsize ¶ added in v0.505.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Target2) UnmarshalMsg ¶ added in v0.505.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Target2) UnmarshalMsgWithCfg ¶ added in v0.505.0
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 Dur time.Duration }
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.