Documentation
¶
Index ¶
- Constants
- type AliasContainer
- type AliasedFieldLimitTestData
- type AliasedIntSlice
- type AliasedMap
- type AliasedSlice
- type AliasedType
- type AliasedType2
- type AliasedType3
- type AliasedType4
- type AllowNil0
- type AllowNil1
- type AllowNil10
- type AllowNilHalfFull
- type AllowNilLotsOFields
- type AllowNilOmitEmpty
- type AllowNilOmitEmpty2
- type AllowNilTestData
- type AllowNilZeroTestData
- type Any
- type Array16
- type Array8
- type ArrayConstants
- type ArrayMapKey
- type AtomicTest
- type BinaryAppenderType
- type BinaryAppenderValue
- type BinaryTestType
- type Block
- type ClearOmitted0
- type ClearOmitted1
- type ClearOmittedA
- type ClearOmittedTuple
- type Common
- type CompatibleArray8
- type CompatibleFloat32
- type CompatibleFloat64
- type CompatibleInt
- type CompatibleMapString
- type CompatibleSliceInt
- type CompatibleStructA
- type CompatibleStructB
- type CompatibleStructC
- type CompatibleStructD
- type CompatibleStructI
- type CompatibleStructS
- type ConvertErr
- type ConvertErrVal
- type ConvertIntf
- type ConvertIntfVal
- type ConvertString
- type ConvertStringMapValue
- type ConvertStringSlice
- type ConvertStringVal
- type Custom
- type CustomBytes
- type CustomInt
- type CustomTag
- type Dummy
- type Duration
- type EmbeddableStruct
- type EmbeddableStruct2
- type EmbeddableStruct2AN
- type EmbeddableStruct2Pointer
- type EmbeddableStructAN
- type EmbeddableStructCO
- type EmbeddableStructCO2
- type EmbeddableStructOZ
- type EmbeddableStructOZ2
- type EmbeddableStructPointer
- type Embedded
- type EmptyStruct
- type ErrorBinaryAppenderType
- type ErrorCtxAsMap
- type ErrorCtxAsTuple
- type ErrorCtxMapChild
- type ErrorCtxMapChildNotInline
- type ErrorCtxTupleChild
- type ErrorCtxTupleChildNotInline
- type ErrorTestType
- type ErrorTextAppenderType
- type ExternalArr
- type ExternalInt
- type ExternalString
- type F64
- type FastAlias
- type FieldLimitTestData
- type FieldOverrideTestData
- type FieldOverrideTestData2
- type FileHandle
- type Files
- type Fixed
- type Float32
- type Float64
- type Floats
- type Flob
- type Flobbity
- type Flobs
- type Foo
- type GenericTest
- type GenericTest2
- type GenericTest3
- type GenericTest3Array
- type GenericTest3List
- type GenericTest3Map
- type GenericTest4
- type GenericTestTwo
- type GenericTestUnused
- type GenericTuple
- type GetUserRequest
- type GetUserRequestWithEmbeddedStruct
- type Insane
- type Int
- type Int64
- type IntA
- type IntB
- type IntC
- type Issue102
- type Issue102MapUsesTuple
- type Issue102Tuple
- type Issue102TupleDeep
- type Issue102TupleUsesMap
- type Issue102TupleUsesTuple
- type Issue102Uses
- type Issue102deep
- type Issue191
- type LimitTestData
- type LimitTestData2
- type LimitedData
- type MapAny
- type MapString
- type MarshalFieldOverrideTestData
- type MarshalLimitTestData
- type MyEnum
- type MyMapKeyStruct
- type MyMapKeyStruct2
- type MyMapKeyStruct3
- type MyStringType
- type NamedBool
- type NamedBoolPointer
- type NamedFloat64
- type NamedFloat64Pointer
- type NamedInt
- type NamedIntPointer
- type NamedMapStringPointer
- type NamedMapStringPointer2
- type NamedMapStructPointer
- type NamedMapStructPointer2
- type NamedString
- type NamedStringCO
- type NamedStringOZ
- type NamedStringPointer
- type NamedStruct
- type NamedStructAN
- type NamedStructCO
- type NamedStructOZ
- type NamedStructPointer
- type NewTime
- type NoAllowNil
- type NonMsgStructTags
- type NotAllowNil10
- type NotOmitEmpty10
- type NumberJSONSample
- type NumberJSONSampleReplace
- type Numberwang
- type ObjMaps
- type ObjSlices
- type Object
- type OmitEmpty0
- type OmitEmpty10
- type OmitEmptyHalfFull
- type OmitEmptyLotsOFields
- type OmitEmptyNoName
- type OmitZero0
- type OmitZero1
- type OmitZeroA
- type OmitZeroExt
- func (o *OmitZeroExt) DecodeMsg(dc *msgp.Reader) (err error)
- func (o OmitZeroExt) EncodeMsg(en *msgp.Writer) (err error)
- func (o OmitZeroExt) IsZero() bool
- func (o OmitZeroExt) MarshalMsg(b []byte) (ret []byte, err error)
- func (o OmitZeroExt) Msgsize() (s int)
- func (o *OmitZeroExt) UnmarshalMsg(bts []byte) (ret []byte, err error)
- type OmitZeroExtPtr
- func (o *OmitZeroExtPtr) DecodeMsg(dc *msgp.Reader) (err error)
- func (o *OmitZeroExtPtr) EncodeMsg(en *msgp.Writer) (err error)
- func (o *OmitZeroExtPtr) IsZero() bool
- func (o *OmitZeroExtPtr) MarshalMsg(b []byte) (ret []byte, err error)
- func (o *OmitZeroExtPtr) Msgsize() (s int)
- func (o *OmitZeroExtPtr) UnmarshalMsg(bts []byte) (ret []byte, err error)
- type OmitZeroTuple
- type Pointer0
- type PointerHalfFull
- type PointerNoName
- type RegexIGNORETest
- type RegexIGNSIZETest
- type SetOf
- type SetOfTuple
- type SliceInt
- type SliceString
- type SpecialID
- type StandaloneBytes
- type StandaloneBytesLimited
- type String
- type StructA
- type StructB
- type StructByteSlice
- type StructC
- type StructD
- type StructI
- type StructS
- type T
- type TestAppendTextString
- type TestBench
- type TestFast
- type TestHidden
- type TestObj
- type TestStruct
- type TestTextAppenderStringPos
- type TestTextMarshalerStringEnd
- type TestTextMarshalerStringMiddle
- type TestType
- type TextAppenderBinType
- type TextAppenderBinValue
- type TextBinTestType
- type TextStringTestType
- type Things
- type Time
- type Tree
- type TypeSample
- type TypeSamples
- type Uint
- type UnlimitedData
- 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 AliasedFieldLimitTestData ¶ added in v1.6.0
type AliasedFieldLimitTestData struct {
SmallAliasedSlice AliasedSlice `msg:"small_aliased_slice,limit=3"`
LargeAliasedSlice AliasedSlice `msg:"large_aliased_slice,limit=50"`
SmallAliasedMap AliasedMap `msg:"small_aliased_map,limit=2"`
LargeAliasedMap AliasedMap `msg:"large_aliased_map,limit=25"`
IntSliceAlias AliasedIntSlice `msg:"int_slice_alias,limit=10"`
NoLimitAlias AliasedSlice `msg:"no_limit_alias"` // Uses file-level limits
}
Test structure with aliased types and field limits
type AliasedIntSlice ¶ added in v1.6.0
type AliasedIntSlice []int
type AliasedMap ¶ added in v1.6.0
type AliasedType ¶ added in v1.5.0
type AliasedType = Fixed
type AliasedType2 ¶ added in v1.5.0
type AliasedType2 = *Fixed
type AliasedType3 ¶ added in v1.5.0
type AliasedType3 = uint64
type AliasedType4 ¶ added in v1.5.0
type AliasedType4 = *uint64
type AllowNil0 ¶ added in v1.1.7
type AllowNil0 struct {
ABool bool `msg:"abool,allownil"`
AInt int `msg:"aint,allownil"`
AInt8 int8 `msg:"aint8,allownil"`
AInt16 int16 `msg:"aint16,allownil"`
AInt32 int32 `msg:"aint32,allownil"`
AInt64 int64 `msg:"aint64,allownil"`
AUint uint `msg:"auint,allownil"`
AUint8 uint8 `msg:"auint8,allownil"`
AUint16 uint16 `msg:"auint16,allownil"`
AUint32 uint32 `msg:"auint32,allownil"`
AUint64 uint64 `msg:"auint64,allownil"`
AFloat32 float32 `msg:"afloat32,allownil"`
AFloat64 float64 `msg:"afloat64,allownil"`
AComplex64 complex64 `msg:"acomplex64,allownil"`
AComplex128 complex128 `msg:"acomplex128,allownil"`
ANamedBool bool `msg:"anamedbool,allownil"`
ANamedInt int `msg:"anamedint,allownil"`
ANamedFloat64 float64 `msg:"anamedfloat64,allownil"`
AMapStrStr map[string]string `msg:"amapstrstr,allownil"`
APtrNamedStr *NamedString `msg:"aptrnamedstr,allownil"`
AString string `msg:"astring,allownil"`
ANamedString string `msg:"anamedstring,allownil"`
AByteSlice []byte `msg:"abyteslice,allownil"`
ASliceString []string `msg:"aslicestring,allownil"`
ASliceNamedString []NamedString `msg:"aslicenamedstring,allownil"`
ANamedStruct NamedStructAN `msg:"anamedstruct,allownil"`
APtrNamedStruct *NamedStructAN `msg:"aptrnamedstruct,allownil"`
AUnnamedStruct struct {
A string `msg:"a,allownil"`
} `msg:"aunnamedstruct,allownil"` // allownil not supported on unnamed struct
EmbeddableStructAN `msg:",flatten,allownil"` // embed flat
EmbeddableStruct2AN `msg:"embeddablestruct2,allownil"` // embed non-flat
AArrayInt [5]int `msg:"aarrayint,allownil"` // not supported
ATime time.Time `msg:"atime,allownil"`
}
type AllowNil1 ¶ added in v1.1.7
type AllowNil1 struct {
ABool []bool `msg:"abool,allownil"`
AInt []int `msg:"aint,allownil"`
AInt8 []int8 `msg:"aint8,allownil"`
AInt16 []int16 `msg:"aint16,allownil"`
AInt32 []int32 `msg:"aint32,allownil"`
AInt64 []int64 `msg:"aint64,allownil"`
AUint []uint `msg:"auint,allownil"`
AUint8 []uint8 `msg:"auint8,allownil"`
AUint16 []uint16 `msg:"auint16,allownil"`
AUint32 []uint32 `msg:"auint32,allownil"`
AUint64 []uint64 `msg:"auint64,allownil"`
AFloat32 []float32 `msg:"afloat32,allownil"`
AFloat64 []float64 `msg:"afloat64,allownil"`
AComplex64 []complex64 `msg:"acomplex64,allownil"`
AComplex128 []complex128 `msg:"acomplex128,allownil"`
ANamedBool []bool `msg:"anamedbool,allownil"`
ANamedInt []int `msg:"anamedint,allownil"`
ANamedFloat64 []float64 `msg:"anamedfloat64,allownil"`
AMapStrStr map[string]string `msg:"amapstrstr,allownil"`
APtrNamedStr *NamedString `msg:"aptrnamedstr,allownil"`
AString []string `msg:"astring,allownil"`
ANamedString []string `msg:"anamedstring,allownil"`
AByteSlice []byte `msg:"abyteslice,allownil"`
ASliceString []string `msg:"aslicestring,allownil"`
ASliceNamedString []NamedString `msg:"aslicenamedstring,allownil"`
ANamedStruct NamedStructAN `msg:"anamedstruct,allownil"`
APtrNamedStruct *NamedStructAN `msg:"aptrnamedstruct,allownil"`
AUnnamedStruct struct {
A []string `msg:"a,allownil"`
} `msg:"aunnamedstruct,allownil"`
*EmbeddableStructAN `msg:",flatten,allownil"` // embed flat
*EmbeddableStruct2AN `msg:"embeddablestruct2,allownil"` // embed non-flat
AArrayInt [5]int `msg:"aarrayint,allownil"` // not supported
ATime *time.Time `msg:"atime,allownil"`
}
type AllowNil10 ¶ added in v1.1.7
type AllowNil10 struct {
Field00 []string `msg:"field00,allownil"`
Field01 []string `msg:"field01,allownil"`
Field02 []string `msg:"field02,allownil"`
Field03 []string `msg:"field03,allownil"`
Field04 []string `msg:"field04,allownil"`
Field05 []string `msg:"field05,allownil"`
Field06 []string `msg:"field06,allownil"`
Field07 []string `msg:"field07,allownil"`
Field08 []string `msg:"field08,allownil"`
Field09 []string `msg:"field09,allownil"`
}
type AllowNilHalfFull ¶ added in v1.1.7
type AllowNilLotsOFields ¶ added in v1.1.7
type AllowNilLotsOFields struct {
Field00 []string `msg:"field00,allownil"`
Field01 []string `msg:"field01,allownil"`
Field02 []string `msg:"field02,allownil"`
Field03 []string `msg:"field03,allownil"`
Field04 []string `msg:"field04,allownil"`
Field05 []string `msg:"field05,allownil"`
Field06 []string `msg:"field06,allownil"`
Field07 []string `msg:"field07,allownil"`
Field08 []string `msg:"field08,allownil"`
Field09 []string `msg:"field09,allownil"`
Field10 []string `msg:"field10,allownil"`
Field11 []string `msg:"field11,allownil"`
Field12 []string `msg:"field12,allownil"`
Field13 []string `msg:"field13,allownil"`
Field14 []string `msg:"field14,allownil"`
Field15 []string `msg:"field15,allownil"`
Field16 []string `msg:"field16,allownil"`
Field17 []string `msg:"field17,allownil"`
Field18 []string `msg:"field18,allownil"`
Field19 []string `msg:"field19,allownil"`
Field20 []string `msg:"field20,allownil"`
Field21 []string `msg:"field21,allownil"`
Field22 []string `msg:"field22,allownil"`
Field23 []string `msg:"field23,allownil"`
Field24 []string `msg:"field24,allownil"`
Field25 []string `msg:"field25,allownil"`
Field26 []string `msg:"field26,allownil"`
Field27 []string `msg:"field27,allownil"`
Field28 []string `msg:"field28,allownil"`
Field29 []string `msg:"field29,allownil"`
Field30 []string `msg:"field30,allownil"`
Field31 []string `msg:"field31,allownil"`
Field32 []string `msg:"field32,allownil"`
Field33 []string `msg:"field33,allownil"`
Field34 []string `msg:"field34,allownil"`
Field35 []string `msg:"field35,allownil"`
Field36 []string `msg:"field36,allownil"`
Field37 []string `msg:"field37,allownil"`
Field38 []string `msg:"field38,allownil"`
Field39 []string `msg:"field39,allownil"`
Field40 []string `msg:"field40,allownil"`
Field41 []string `msg:"field41,allownil"`
Field42 []string `msg:"field42,allownil"`
Field43 []string `msg:"field43,allownil"`
Field44 []string `msg:"field44,allownil"`
Field45 []string `msg:"field45,allownil"`
Field46 []string `msg:"field46,allownil"`
Field47 []string `msg:"field47,allownil"`
Field48 []string `msg:"field48,allownil"`
Field49 []string `msg:"field49,allownil"`
Field50 []string `msg:"field50,allownil"`
Field51 []string `msg:"field51,allownil"`
Field52 []string `msg:"field52,allownil"`
Field53 []string `msg:"field53,allownil"`
Field54 []string `msg:"field54,allownil"`
Field55 []string `msg:"field55,allownil"`
Field56 []string `msg:"field56,allownil"`
Field57 []string `msg:"field57,allownil"`
Field58 []string `msg:"field58,allownil"`
Field59 []string `msg:"field59,allownil"`
Field60 []string `msg:"field60,allownil"`
Field61 []string `msg:"field61,allownil"`
Field62 []string `msg:"field62,allownil"`
Field63 []string `msg:"field63,allownil"`
Field64 []string `msg:"field64,allownil"`
Field65 []string `msg:"field65,allownil"`
Field66 []string `msg:"field66,allownil"`
Field67 []string `msg:"field67,allownil"`
Field68 []string `msg:"field68,allownil"`
Field69 []string `msg:"field69,allownil"`
}
type AllowNilOmitEmpty ¶ added in v1.1.7
type AllowNilOmitEmpty2 ¶ added in v1.1.7
type AllowNilTestData ¶ added in v1.6.0
type AllowNilTestData struct {
NilSlice []byte `msg:"nil_slice,allownil"` // Can be nil, uses file limit (100)
NilTightSlice []int `msg:"nil_tight_slice,allownil,limit=5"` // Can be nil, field limit (5) < file limit (100)
NilLooseSlice []string `msg:"nil_loose_slice,allownil,limit=200"` // Can be nil, field limit (200) > file limit (100)
NilZCSlice []byte `msg:"nil_zc_slice,allownil,zerocopy"` // Can be nil, zerocopy, uses file limit (100)
NilZCTightSlice []byte `msg:"nil_zc_tight_slice,allownil,zerocopy,limit=5"` // Can be nil, zerocopy, field limit (5)
NilMap map[string]int `msg:"nil_map,allownil"` // Can be nil, uses file limit (50)
NilTightMap map[string]int `msg:"nil_tight_map,allownil,limit=3"` // Can be nil, field limit (3) < file limit (50)
NilLooseMap map[int]string `msg:"nil_loose_map,allownil,limit=75"` // Can be nil, field limit (75) > file limit (50)
RegularSlice []byte `msg:"regular_slice"` // Cannot be nil, uses file limit (100)
RegularMap map[string]int `msg:"regular_map"` // Cannot be nil, uses file limit (50)
ObjSlice []LimitedData `msg:"obj_slice"` // Cannot be nil, uses file limit (100)
ObjMap map[string]LimitedData `msg:"obj_map"` // Cannot be nil, uses file limit (50)
}
Test allownil functionality with limits File limits: arrays:100 maps:50
type AllowNilZeroTestData ¶ added in v1.6.0
type AllowNilZeroTestData struct {
NilBytes []byte `msg:"nil_bytes,allownil"` // Can be nil, should allocate zero-sized slice
RegularBytes []byte `msg:"regular_bytes"` // Cannot be nil
}
Test allownil with zero-sized allocations
type ArrayConstants ¶ added in v1.1.0
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 [0o7]string
}
type ArrayMapKey ¶ added in v1.4.0
type ArrayMapKey [4]byte
type AtomicTest ¶ added in v1.5.0
type AtomicTest struct {
A atomic.Int64
B atomic.Uint64
C atomic.Int32
D atomic.Uint32
E atomic.Bool
Omitted struct {
A atomic.Int64 `msg:",omitempty"`
B atomic.Uint64 `msg:",omitempty"`
C atomic.Int32 `msg:",omitempty"`
D atomic.Uint32 `msg:",omitempty"`
E atomic.Bool `msg:",omitempty"`
}
Ptr struct {
A *atomic.Int64
B *atomic.Uint64
C *atomic.Int32
D *atomic.Uint32
E *atomic.Bool
Omitted struct {
A *atomic.Int64 `msg:",omitempty"`
B *atomic.Uint64 `msg:",omitempty"`
C *atomic.Int32 `msg:",omitempty"`
D *atomic.Uint32 `msg:",omitempty"`
E *atomic.Bool `msg:",omitempty"`
}
}
F []atomic.Int32
G []*atomic.Int32
// We use pointers, as values don't make sense for maps.
H map[string]*atomic.Int32
}
type BinaryAppenderType ¶ added in v1.6.0
type BinaryAppenderType struct {
Value string
}
BinaryAppenderType implements encoding.BinaryAppender (Go 1.22+)
func (*BinaryAppenderType) AppendBinary ¶ added in v1.6.0
func (t *BinaryAppenderType) AppendBinary(dst []byte) ([]byte, error)
func (*BinaryAppenderType) UnmarshalBinary ¶ added in v1.6.0
func (t *BinaryAppenderType) UnmarshalBinary(data []byte) error
type BinaryAppenderValue ¶ added in v1.6.0
type BinaryAppenderValue struct {
Value string `msg:"-"`
}
BinaryAppenderValue implements encoding.BinaryAppender (Go 1.22+)
func (BinaryAppenderValue) AppendBinary ¶ added in v1.6.0
func (t BinaryAppenderValue) AppendBinary(dst []byte) ([]byte, error)
func (*BinaryAppenderValue) UnmarshalBinary ¶ added in v1.6.0
func (t *BinaryAppenderValue) UnmarshalBinary(data []byte) error
type BinaryTestType ¶ added in v1.6.0
type BinaryTestType struct {
Value string
}
BinaryTestType implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler
func (*BinaryTestType) MarshalBinary ¶ added in v1.6.0
func (t *BinaryTestType) MarshalBinary() ([]byte, error)
func (*BinaryTestType) UnmarshalBinary ¶ added in v1.6.0
func (t *BinaryTestType) UnmarshalBinary(data []byte) error
type ClearOmitted0 ¶ added in v1.2.3
type ClearOmitted0 struct {
AStruct ClearOmittedA `msg:"astruct,omitempty"` // leave this one omitempty
BStruct ClearOmittedA `msg:"bstruct,omitzero"` // and compare to this
AStructPtr *ClearOmittedA `msg:"astructptr,omitempty"` // a pointer case omitempty
BStructPtr *ClearOmittedA `msg:"bstructptr,omitzero"` // a pointer case omitzero
AExt OmitZeroExt `msg:"aext,omitzero"` // external type case
// more
APtrNamedStr *NamedStringCO `msg:"aptrnamedstr,omitzero"`
ANamedStruct NamedStructCO `msg:"anamedstruct,omitzero"`
APtrNamedStruct *NamedStructCO `msg:"aptrnamedstruct,omitzero"`
EmbeddableStructCO `msg:",flatten,omitzero"` // embed flat
EmbeddableStructCO2 `msg:"embeddablestruct2,omitzero"` // embed non-flat
ATime time.Time `msg:"atime,omitzero"`
ASlice []int `msg:"aslice,omitempty"`
AMap map[string]int `msg:"amap,omitempty"`
ABin []byte `msg:"abin,omitempty"`
AInt int `msg:"aint,omitempty"`
AString string `msg:"atring,omitempty"`
Adur time.Duration `msg:"adur,omitempty"`
AJSON json.Number `msg:"ajson,omitempty"`
AnAny any `msg:"anany,omitempty"`
ClearOmittedTuple ClearOmittedTuple `msg:"ozt"` // the inside of a tuple should ignore both omitempty and omitzero
}
type ClearOmitted1 ¶ added in v1.2.3
type ClearOmitted1 struct {
T1 ClearOmittedTuple `msg:"t1"`
}
type ClearOmittedA ¶ added in v1.2.3
type ClearOmittedA struct {
A string `msg:"a,omitempty"`
B NamedStringCO `msg:"b,omitzero"`
C NamedStringCO `msg:"c,omitzero"`
}
func (*ClearOmittedA) IsZero ¶ added in v1.2.3
func (o *ClearOmittedA) IsZero() bool
type ClearOmittedTuple ¶ added in v1.2.3
type ClearOmittedTuple struct {
FieldA string `msg:"fielda,omitempty"`
FieldB NamedStringCO `msg:"fieldb,omitzero"`
FieldC NamedStringCO `msg:"fieldc,omitzero"`
}
ClearOmittedTuple is flagged for tuple output, it should ignore all omitempty and omitzero functionality since it's fundamentally incompatible.
type CompatibleArray8 ¶ added in v1.2.0
type CompatibleArray8 [8]byte
type CompatibleFloat32 ¶ added in v1.2.0
type CompatibleFloat32 float32
type CompatibleFloat64 ¶ added in v1.2.0
type CompatibleFloat64 float64
type CompatibleInt ¶ added in v1.2.0
type CompatibleInt int
type CompatibleMapString ¶ added in v1.2.0
type CompatibleSliceInt ¶ added in v1.2.0
type CompatibleSliceInt []Int
type CompatibleStructA ¶ added in v1.2.0
type CompatibleStructB ¶ added in v1.2.0
type CompatibleStructC ¶ added in v1.2.0
type CompatibleStructD ¶ added in v1.2.0
type CompatibleStructI ¶ added in v1.2.0
type CompatibleStructS ¶ added in v1.2.0
type CompatibleStructS struct {
Slice SliceInt
}
type ConvertErr ¶ added in v1.1.0
type ConvertErr struct {
Err ConvertErrVal
}
type ConvertErrVal ¶ added in v1.1.0
type ConvertErrVal string
type ConvertIntf ¶ added in v1.1.0
type ConvertIntf struct {
Intf ConvertIntfVal
}
type ConvertIntfVal ¶ added in v1.1.0
type ConvertIntfVal struct {
Test string
}
type ConvertString ¶ added in v1.1.0
type ConvertString struct {
String ConvertStringVal
}
type ConvertStringMapValue ¶ added in v1.1.0
type ConvertStringMapValue struct {
Strings map[string]ConvertStringVal
}
type ConvertStringSlice ¶ added in v1.1.0
type ConvertStringSlice struct {
Strings []ConvertStringVal
}
type ConvertStringVal ¶ added in v1.1.0
type ConvertStringVal string
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 EmbeddableStruct ¶ added in v1.1.1
type EmbeddableStruct struct {
SomeEmbed string `msg:"someembed,omitempty"`
}
type EmbeddableStruct2 ¶ added in v1.1.1
type EmbeddableStruct2 struct {
SomeEmbed2 string `msg:"someembed2,omitempty"`
}
type EmbeddableStruct2AN ¶ added in v1.1.7
type EmbeddableStruct2AN struct {
SomeEmbed2 []string `msg:"someembed2,allownil"`
}
type EmbeddableStruct2Pointer ¶ added in v1.2.1
type EmbeddableStruct2Pointer struct {
SomeEmbed2 string `msg:"someembed2"`
}
type EmbeddableStructAN ¶ added in v1.1.7
type EmbeddableStructAN struct {
SomeEmbed []string `msg:"someembed,allownil"`
}
type EmbeddableStructCO ¶ added in v1.2.3
type EmbeddableStructCO struct {
SomeEmbed string `msg:"someembed2,omitempty"`
}
func (EmbeddableStructCO) IsZero ¶ added in v1.2.3
func (es EmbeddableStructCO) IsZero() bool
type EmbeddableStructCO2 ¶ added in v1.2.3
type EmbeddableStructCO2 struct {
SomeEmbed2 string `msg:"someembed2,omitempty"`
}
func (EmbeddableStructCO2) IsZero ¶ added in v1.2.3
func (es EmbeddableStructCO2) IsZero() bool
type EmbeddableStructOZ ¶ added in v1.2.0
type EmbeddableStructOZ struct {
SomeEmbed string `msg:"someembed2,omitempty"`
}
func (EmbeddableStructOZ) IsZero ¶ added in v1.2.0
func (es EmbeddableStructOZ) IsZero() bool
type EmbeddableStructOZ2 ¶ added in v1.2.0
type EmbeddableStructOZ2 struct {
SomeEmbed2 string `msg:"someembed2,omitempty"`
}
func (EmbeddableStructOZ2) IsZero ¶ added in v1.2.0
func (es EmbeddableStructOZ2) IsZero() bool
type EmbeddableStructPointer ¶ added in v1.2.1
type EmbeddableStructPointer struct {
SomeEmbed string `msg:"someembed"`
}
type EmptyStruct ¶ added in v1.2.0
type EmptyStruct struct{}
type ErrorBinaryAppenderType ¶ added in v1.6.0
ErrorBinaryAppenderType for testing error conditions with BinaryAppender
func (*ErrorBinaryAppenderType) AppendBinary ¶ added in v1.6.0
func (e *ErrorBinaryAppenderType) AppendBinary(dst []byte) ([]byte, error)
func (*ErrorBinaryAppenderType) UnmarshalBinary ¶ added in v1.6.0
func (e *ErrorBinaryAppenderType) UnmarshalBinary(data []byte) error
type ErrorCtxAsMap ¶ added in v1.1.0
type ErrorCtxAsMap struct {
Val string
Child *ErrorCtxMapChild
Children []*ErrorCtxMapChild
ComplexChild *ErrorCtxMapChildNotInline
Map map[string]string
Nest struct {
Val string
Child *ErrorCtxMapChild
Children []*ErrorCtxMapChild
Map map[string]string
Nest struct {
Val string
Child *ErrorCtxMapChild
Children []*ErrorCtxMapChild
Map map[string]string
}
}
}
type ErrorCtxAsTuple ¶ added in v1.1.0
type ErrorCtxAsTuple struct {
Val string
Child *ErrorCtxTupleChild
Children []*ErrorCtxTupleChild
ComplexChild *ErrorCtxTupleChildNotInline
Map map[string]string
Nest struct {
Val string
Child *ErrorCtxTupleChild
Children []*ErrorCtxTupleChild
Map map[string]string
Nest struct {
Val string
Child *ErrorCtxTupleChild
Children []*ErrorCtxTupleChild
Map map[string]string
}
}
}
type ErrorCtxMapChild ¶ added in v1.1.0
type ErrorCtxMapChild struct {
Val string
}
type ErrorCtxMapChildNotInline ¶ added in v1.1.0
type ErrorCtxMapChildNotInline struct {
Val1, Val2, Val3, Val4, Val5 string
}
type ErrorCtxTupleChild ¶ added in v1.1.0
type ErrorCtxTupleChild struct {
Val string
}
type ErrorCtxTupleChildNotInline ¶ added in v1.1.0
type ErrorCtxTupleChildNotInline struct {
Val1, Val2, Val3, Val4, Val5 string
}
type ErrorTestType ¶ added in v1.6.0
type ErrorTestType struct {
ShouldError bool
}
ErrorTestType for testing error conditions
func (*ErrorTestType) MarshalBinary ¶ added in v1.6.0
func (e *ErrorTestType) MarshalBinary() ([]byte, error)
func (*ErrorTestType) UnmarshalBinary ¶ added in v1.6.0
func (e *ErrorTestType) UnmarshalBinary(data []byte) error
type ErrorTextAppenderType ¶ added in v1.6.0
ErrorTextAppenderType for testing error conditions with TextAppender
func (*ErrorTextAppenderType) AppendText ¶ added in v1.6.0
func (e *ErrorTextAppenderType) AppendText(dst []byte) ([]byte, error)
func (*ErrorTextAppenderType) UnmarshalText ¶ added in v1.6.0
func (e *ErrorTextAppenderType) UnmarshalText(text []byte) error
type ExternalArr ¶ added in v1.4.0
type ExternalArr [4]byte
type ExternalInt ¶ added in v1.4.0
type ExternalInt int
type ExternalString ¶ added in v1.4.0
type ExternalString string
type FieldLimitTestData ¶ added in v1.6.0
type FieldLimitTestData struct {
SmallSlice []int `msg:"small_slice,limit=5"`
LargeSlice []string `msg:"large_slice,limit=100"`
SmallMap map[string]int `msg:"small_map,limit=3"`
LargeMap map[int]string `msg:"large_map,limit=20"`
NoLimit []byte `msg:"no_limit"` // Uses file-level limits if any
FixedArray [10]int `msg:"fixed_array,limit=2"` // Should be ignored
}
Test structures for field-level limit tags
type FieldOverrideTestData ¶ added in v1.6.0
type FieldOverrideTestData struct {
TightSlice []int `msg:"tight_slice,limit=10"` // Field limit (10) < file limit (100)
LooseSlice []string `msg:"loose_slice,limit=200"` // Field limit (200) > file limit (100)
TightMap map[string]int `msg:"tight_map,limit=5"` // Field limit (5) < file limit (50)
LooseMap map[int]string `msg:"loose_map,limit=80"` // Field limit (80) > file limit (50)
DefaultSlice []byte `msg:"default_slice"` // No field limit, uses file limit (100)
DefaultMap map[string]string `msg:"default_map"` // No field limit, uses file limit (50)
}
Test field limits vs file limits precedence File limits: arrays:100 maps:50
type FieldOverrideTestData2 ¶ added in v1.6.0
type FieldOverrideTestData2 struct {
TightSlice []int `msg:"tight_slice,limit=30"` // Field limit (30) < file limit (200)
MediumSlice []string `msg:"medium_slice,limit=150"` // Field limit (150) < file limit (200)
LooseSlice []byte `msg:"loose_slice,limit=300"` // Field limit (300) > file limit (200)
TightMap map[string]int `msg:"tight_map,limit=20"` // Field limit (20) < file limit (100)
MediumMap map[int]string `msg:"medium_map,limit=75"` // Field limit (75) < file limit (100)
LooseMap map[string][]int `msg:"loose_map,limit=150"` // Field limit (150) > file limit (100)
DefaultSlice []int `msg:"default_slice"` // No field limit, uses file limit (200)
DefaultMap map[int]int `msg:"default_map"` // No field limit, uses file limit (100)
}
Test field limits vs file limits precedence with different file limits File limits: arrays:200 maps:100
type FileHandle ¶
type Flob ¶ added in v1.2.5
type Flob struct {
X Numberwang `msg:"x"`
Y int8 `msg:"y"`
Z int8 `msg:"z"`
W int32 `msg:"w"`
}
type GenericTest ¶ added in v1.5.0
type GenericTest[T any, P msgp.RTFor[T]] struct { A T B P C []T `msg:",allownil"` D map[string]T `msg:",allownil"` E GenericTest2[T, P, string] F []GenericTest2[T, P, string] `msg:",allownil"` G map[string]GenericTest2[T, P, string] `msg:",allownil"` AP *T CP []*T `msg:",allownil"` DP map[string]*T `msg:",allownil"` EP *GenericTest2[T, P, string] FP []*GenericTest2[T, P, string] `msg:",allownil"` GP map[string]*GenericTest2[T, P, string] `msg:",allownil"` }
type GenericTest3 ¶ added in v1.5.0
type GenericTest3Array ¶ added in v1.6.0
type GenericTest3List ¶ added in v1.6.0
type GenericTest3Map ¶ added in v1.6.0
type GenericTest4 ¶ added in v1.6.0
GenericTest4 has the msgp.RTFor constraint as a sub-constraint.
type GenericTestTwo ¶ added in v1.5.0
type GenericTestTwo[A, B any, AP msgp.RTFor[A], BP msgp.RTFor[B]] struct { A A B AP C []A `msg:",allownil"` D map[string]T `msg:",allownil"` E GenericTest2[A, AP, string] F []GenericTest2[A, AP, string] `msg:",allownil"` G map[string]GenericTest2[A, AP, string] `msg:",allownil"` AP *A CP []*A `msg:",allownil"` DP map[string]*A `msg:",allownil"` EP *GenericTest2[A, AP, string] FP []*GenericTest2[A, AP, string] `msg:",allownil"` GP map[string]*GenericTest2[A, AP, string] `msg:",allownil"` A2 B B2 BP C2 []B `msg:",allownil"` D2 map[string]B `msg:",allownil"` E2 GenericTest2[B, BP, string] F2 []GenericTest2[B, BP, string] `msg:",allownil"` G2 map[string]GenericTest2[B, BP, string] `msg:",allownil"` AP2 *B CP2 []*B `msg:",allownil"` DP2 map[string]*B `msg:",allownil"` EP2 *GenericTest2[B, BP, string] FP2 []*GenericTest2[B, BP, string] `msg:",allownil"` GP2 map[string]*GenericTest2[B, BP, string] `msg:",allownil"` }
type GenericTestUnused ¶ added in v1.5.0
Type that doesn't have any fields using the generic type should just output valid code.
type GenericTuple ¶ added in v1.5.0
type GenericTuple[T any, P msgp.RTFor[T], B any] struct { A T B P C []T `msg:",allownil"` D map[string]T `msg:",allownil"` E GenericTest2[T, P, string] F []GenericTest2[T, P, string] `msg:",allownil"` G map[string]GenericTest2[T, P, string] `msg:",allownil"` AP *T CP []*T `msg:",allownil"` DP map[string]*T `msg:",allownil"` EP *GenericTest2[T, P, string] FP []*GenericTest2[T, P, string] `msg:",allownil"` GP map[string]*GenericTest2[T, P, string] `msg:",allownil"` }
type GetUserRequest ¶ added in v1.1.1
type GetUserRequestWithEmbeddedStruct ¶ added in v1.1.1
type Issue102MapUsesTuple ¶ added in v1.1.0
type Issue102MapUsesTuple struct {
Nested Issue102Tuple
NestedPtr *Issue102Tuple
}
type Issue102Tuple ¶ added in v1.1.0
type Issue102Tuple struct{}
type Issue102TupleDeep ¶ added in v1.1.0
type Issue102TupleUsesMap ¶ added in v1.1.0
type Issue102TupleUsesTuple ¶ added in v1.1.0
type Issue102TupleUsesTuple struct {
Nested Issue102Tuple
NestedPtr *Issue102Tuple
}
type Issue102Uses ¶ added in v1.1.0
type Issue102deep ¶ added in v1.1.0
type LimitTestData ¶ added in v1.6.0
type LimitTestData2 ¶ added in v1.6.0
type LimitedData ¶ added in v1.6.0
type LimitedData struct {
SmallArray [10]int `msg:"small_array"`
LargeSlice []byte `msg:"large_slice"`
SmallMap map[string]int `msg:"small_map"`
}
Test structures for limit directive
type MarshalFieldOverrideTestData ¶ added in v1.6.0
type MarshalFieldOverrideTestData struct {
TightSlice []int `msg:"tight_slice,limit=10"` // Field limit (10) < file limit (30)
LooseSlice []string `msg:"loose_slice,limit=50"` // Field limit (50) > file limit (30)
TightMap map[string]int `msg:"tight_map,limit=5"` // Field limit (5) < file limit (20)
LooseMap map[int]string `msg:"loose_map,limit=40"` // Field limit (40) > file limit (20)
DefaultSlice []byte `msg:"default_slice"` // No field limit, uses file limit (30)
DefaultMap map[string]byte `msg:"default_map"` // No field limit, uses file limit (20)
}
Test field limits vs file limits precedence with marshal:true File limits: arrays:30 maps:20 marshal:true
type MarshalLimitTestData ¶ added in v1.6.0
type MarshalLimitTestData struct {
SmallArray [5]int `msg:"small_array"`
TestSlice []string `msg:"test_slice"`
TestMap map[string]int `msg:"test_map"`
}
Test structures for marshal-time limit enforcement
type MyMapKeyStruct ¶ added in v1.4.0
type MyMapKeyStruct struct {
Map map[mapKey]int `msg:",allownil"` // Keys are converted to strings via shim
MapS map[mapKeyString]int `msg:",allownil"` // Keys are strings, with conversion
MapX map[ExternalString]int `msg:",allownil"` // Keys is an external type to the file, replaced with a cast
MapB map[mapKeyBytes]int `msg:",allownil"` // Keys are bytes, converted to hex strings via shim
MapUint map[uint64]int `msg:",allownil"` // Will be ignored (as current behavior)
Original map[string]int `msg:",allownil"` // Original map, for comparison purposes
// Should all be ignored:
MapFloat32 map[float32]int `msg:",allownil"`
MapFloat64 map[float64]int `msg:",allownil"`
MapComplex64 map[complex64]int `msg:",allownil"`
MapComplex128 map[complex128]int `msg:",allownil"`
MapUint2 map[uint]int `msg:",allownil"`
MapUint8 map[uint8]int `msg:",allownil"`
MapUint16 map[uint16]int `msg:",allownil"`
MapUint32 map[uint32]int `msg:",allownil"`
MapUint64 map[uint64]int `msg:",allownil"`
MapByte map[byte]int `msg:",allownil"`
MapInt map[int]int `msg:",allownil"`
MapInt8 map[int8]int `msg:",allownil"`
MapInt16 map[int16]int `msg:",allownil"`
MapInt32 map[int32]int `msg:",allownil"`
MapInt64 map[int64]int `msg:",allownil"`
MapBool map[bool]int `msg:",allownil"`
}
type MyMapKeyStruct2 ¶ added in v1.4.0
type MyMapKeyStruct2 struct {
MapString map[string]int `msg:",allownil"`
MapString2 map[MyStringType]int `msg:",allownil"`
MapString3 map[ExternalString]int `msg:",allownil"`
MapString4 map[mapKeyBytes2]int `msg:",allownil"`
MapFloat32 map[float32]int `msg:",allownil"`
MapFloat64 map[float64]int `msg:",allownil"`
MapComplex64 map[complex64]int `msg:",allownil"`
MapComplex128 map[complex128]int `msg:",allownil"`
MapUint map[uint]int `msg:",allownil"`
MapUint8 map[uint8]int `msg:",allownil"`
MapUint16 map[uint16]int `msg:",allownil"`
MapUint32 map[uint32]int `msg:",allownil"`
MapUint64 map[uint64]int `msg:",allownil"`
MapByte map[byte]int `msg:",allownil"`
MapInt map[int]int `msg:",allownil"`
MapInt8 map[int8]int `msg:",allownil"`
MapInt16 map[int16]int `msg:",allownil"`
MapInt32 map[int32]int `msg:",allownil"`
MapInt64 map[int64]int `msg:",allownil"`
MapBool map[bool]int `msg:",allownil"`
MapMapInt map[int]map[int]int `msg:",allownil"`
// Maps with array keys
MapArray map[[4]byte]int `msg:",allownil"`
MapArray2 map[ArrayMapKey]int `msg:",allownil"`
MapArray3 map[ExternalArr]int `msg:",allownil"`
MapArray4 map[[4]uint32]int `msg:",allownil"`
// Maps with shimmed types
MapDuration map[mapKeyShimmed]int `msg:",allownil"`
}
type MyMapKeyStruct3 ¶ added in v1.4.0
type MyMapKeyStruct3 struct {
MapString map[string]int `msg:",allownil"`
MapString3 map[ExternalString]int `msg:",allownil"`
MapString2 map[ExternalInt]int `msg:",allownil"`
MapFloat32 map[float32]int `msg:",allownil"`
MapFloat64 map[float64]int `msg:",allownil"`
MapUint map[uint]int `msg:",allownil"`
MapUint8 map[uint8]int `msg:",allownil"`
MapUint16 map[uint16]int `msg:",allownil"`
MapUint32 map[uint32]int `msg:",allownil"`
MapUint64 map[uint64]int `msg:",allownil"`
MapByte map[byte]int `msg:",allownil"`
MapInt map[int]int `msg:",allownil"`
MapInt8 map[int8]int `msg:",allownil"`
MapInt16 map[int16]int `msg:",allownil"`
MapInt32 map[int32]int `msg:",allownil"`
MapInt64 map[int64]int `msg:",allownil"`
MapBool map[bool]int `msg:",allownil"`
MapMapInt map[int]map[int]int `msg:",allownil"`
// Maps with unsupported base types.
MapArray map[[4]byte]int `msg:",allownil"` // Ignored
MapArray4 map[[4]uint32]int `msg:",allownil"` // Ignored
MapComplex64 map[complex64]int `msg:",allownil"` // Ignored
MapComplex128 map[complex128]int `msg:",allownil"` // Ignored
}
type MyStringType ¶ added in v1.4.0
type MyStringType string
type NamedBoolPointer ¶ added in v1.2.1
type NamedBoolPointer bool
type NamedFloat64 ¶ added in v1.1.1
type NamedFloat64 float64
type NamedFloat64Pointer ¶ added in v1.2.1
type NamedFloat64Pointer float64
type NamedIntPointer ¶ added in v1.2.1
type NamedIntPointer int
type NamedMapStringPointer ¶ added in v1.2.1
type NamedMapStringPointer map[string]NamedStringPointer
type NamedMapStringPointer2 ¶ added in v1.2.1
type NamedMapStringPointer2 map[string]*NamedStringPointer
type NamedMapStructPointer ¶ added in v1.2.1
type NamedMapStructPointer2 ¶ added in v1.2.1
type NamedString ¶ added in v1.1.1
type NamedString string
type NamedStringCO ¶ added in v1.2.3
type NamedStringCO string
func (*NamedStringCO) IsZero ¶ added in v1.2.3
func (ns *NamedStringCO) IsZero() bool
type NamedStringOZ ¶ added in v1.2.0
type NamedStringOZ string
func (*NamedStringOZ) IsZero ¶ added in v1.2.0
func (ns *NamedStringOZ) IsZero() bool
type NamedStringPointer ¶ added in v1.2.1
type NamedStringPointer string
type NamedStruct ¶ added in v1.1.1
type NamedStructAN ¶ added in v1.1.7
type NamedStructCO ¶ added in v1.2.3
func (*NamedStructCO) IsZero ¶ added in v1.2.3
func (ns *NamedStructCO) IsZero() bool
type NamedStructOZ ¶ added in v1.2.0
func (*NamedStructOZ) IsZero ¶ added in v1.2.0
func (ns *NamedStructOZ) IsZero() bool
type NamedStructPointer ¶ added in v1.2.1
type NoAllowNil ¶ added in v1.2.3
type NoAllowNil []byte
Primitive types cannot have allownil for now.
type NonMsgStructTags ¶ added in v1.1.0
type NonMsgStructTags struct {
A []string `json:"fooJSON" msg:"fooMsgp"`
B string `json:"barJSON"`
C []string `json:"bazJSON" msg:"-"`
Nested []struct {
A []string `json:"a"`
B string `json:"b"`
C []string `json:"c"`
VeryNested []struct {
A []string `json:"a"`
B []string `msg:"bbbb" xml:"-"`
C map[string]struct{} `msg:"cccc"`
}
}
}
type NotAllowNil10 ¶ added in v1.1.7
type NotAllowNil10 struct {
Field00 []string `msg:"field00"`
Field01 []string `msg:"field01"`
Field02 []string `msg:"field02"`
Field03 []string `msg:"field03"`
Field04 []string `msg:"field04"`
Field05 []string `msg:"field05"`
Field06 []string `msg:"field06"`
Field07 []string `msg:"field07"`
Field08 []string `msg:"field08"`
Field09 []string `msg:"field09"`
}
type NotOmitEmpty10 ¶ added in v1.1.1
type NotOmitEmpty10 struct {
Field00 string `msg:"field00"`
Field01 string `msg:"field01"`
Field02 string `msg:"field02"`
Field03 string `msg:"field03"`
Field04 string `msg:"field04"`
Field05 string `msg:"field05"`
Field06 string `msg:"field06"`
Field07 string `msg:"field07"`
Field08 string `msg:"field08"`
Field09 string `msg:"field09"`
}
type NumberJSONSample ¶ added in v1.2.2
type NumberJSONSampleReplace ¶ added in v1.2.2
type Numberwang ¶ added in v1.2.5
type Numberwang int8
type ObjMaps ¶ added in v1.6.0
type ObjMaps map[string]LimitedData
type ObjSlices ¶ added in v1.6.0
type ObjSlices []LimitedData
type Object ¶
type Object struct {
ObjectNo string `msg:"objno"`
Slice1 []string `msg:"slice1"`
Slice2 []string `msg:"slice2"`
MapMap map[string]map[string]string
MapStringEmpty map[string]struct{}
MapStringEmpty2 map[string]EmptyStruct
ZCBytes []byte `msg:",zerocopy"`
ZCBytesAN []byte `msg:",zerocopy,allownil"`
ZCBytesOE []byte `msg:",zerocopy,omitempty"`
ZCBytesSlice [][]byte `msg:",zerocopy"`
ZCBytesArr [2][]byte `msg:",zerocopy"`
ZCBytesMap map[string][]byte `msg:",zerocopy"`
ZCBytesMapDeep map[string]map[string][]byte `msg:",zerocopy"`
CustomBytes CustomBytes `msg:",zerocopy"`
}
type OmitEmpty0 ¶ added in v1.1.1
type OmitEmpty0 struct {
ABool bool `msg:"abool,omitempty"`
AInt int `msg:"aint,omitempty"`
AInt8 int8 `msg:"aint8,omitempty"`
AInt16 int16 `msg:"aint16,omitempty"`
AInt32 int32 `msg:"aint32,omitempty"`
AInt64 int64 `msg:"aint64,omitempty"`
AUint uint `msg:"auint,omitempty"`
AUint8 uint8 `msg:"auint8,omitempty"`
AUint16 uint16 `msg:"auint16,omitempty"`
AUint32 uint32 `msg:"auint32,omitempty"`
AUint64 uint64 `msg:"auint64,omitempty"`
AFloat32 float32 `msg:"afloat32,omitempty"`
AFloat64 float64 `msg:"afloat64,omitempty"`
AComplex64 complex64 `msg:"acomplex64,omitempty"`
AComplex128 complex128 `msg:"acomplex128,omitempty"`
ANamedBool bool `msg:"anamedbool,omitempty"`
ANamedInt int `msg:"anamedint,omitempty"`
ANamedFloat64 float64 `msg:"anamedfloat64,omitempty"`
AMapStrStr map[string]string `msg:"amapstrstr,omitempty"`
APtrNamedStr *NamedString `msg:"aptrnamedstr,omitempty"`
AString string `msg:"astring,omitempty"`
ANamedString string `msg:"anamedstring,omitempty"`
AByteSlice []byte `msg:"abyteslice,omitempty"`
ASliceByteSlice [][]byte `msg:"aslicebyteslice,omitempty"`
AMapByteSlice map[string][]byte `msg:"amapbyteslice,omitempty"`
ASliceString []string `msg:"aslicestring,omitempty"`
ASliceNamedString []NamedString `msg:"aslicenamedstring,omitempty"`
ANamedStruct NamedStruct `msg:"anamedstruct,omitempty"`
APtrNamedStruct *NamedStruct `msg:"aptrnamedstruct,omitempty"`
AUnnamedStruct struct {
A string `msg:"a,omitempty"`
} `msg:"aunnamedstruct,omitempty"` // omitempty not supported on unnamed struct
EmbeddableStruct `msg:",flatten,omitempty"` // embed flat
EmbeddableStruct2 `msg:"embeddablestruct2,omitempty"` // embed non-flat
AArrayInt [5]int `msg:"aarrayint,omitempty"` // not supported
ATime time.Time `msg:"atime,omitempty"`
}
type OmitEmpty10 ¶ added in v1.1.1
type OmitEmpty10 struct {
Field00 string `msg:"field00,omitempty"`
Field01 string `msg:"field01,omitempty"`
Field02 string `msg:"field02,omitempty"`
Field03 string `msg:"field03,omitempty"`
Field04 string `msg:"field04,omitempty"`
Field05 string `msg:"field05,omitempty"`
Field06 string `msg:"field06,omitempty"`
Field07 string `msg:"field07,omitempty"`
Field08 string `msg:"field08,omitempty"`
Field09 string `msg:"field09,omitempty"`
}
type OmitEmptyHalfFull ¶ added in v1.1.1
type OmitEmptyLotsOFields ¶ added in v1.1.1
type OmitEmptyLotsOFields struct {
Field00 string `msg:"field00,omitempty"`
Field01 string `msg:"field01,omitempty"`
Field02 string `msg:"field02,omitempty"`
Field03 string `msg:"field03,omitempty"`
Field04 string `msg:"field04,omitempty"`
Field05 string `msg:"field05,omitempty"`
Field06 string `msg:"field06,omitempty"`
Field07 string `msg:"field07,omitempty"`
Field08 string `msg:"field08,omitempty"`
Field09 string `msg:"field09,omitempty"`
Field10 string `msg:"field10,omitempty"`
Field11 string `msg:"field11,omitempty"`
Field12 string `msg:"field12,omitempty"`
Field13 string `msg:"field13,omitempty"`
Field14 string `msg:"field14,omitempty"`
Field15 string `msg:"field15,omitempty"`
Field16 string `msg:"field16,omitempty"`
Field17 string `msg:"field17,omitempty"`
Field18 string `msg:"field18,omitempty"`
Field19 string `msg:"field19,omitempty"`
Field20 string `msg:"field20,omitempty"`
Field21 string `msg:"field21,omitempty"`
Field22 string `msg:"field22,omitempty"`
Field23 string `msg:"field23,omitempty"`
Field24 string `msg:"field24,omitempty"`
Field25 string `msg:"field25,omitempty"`
Field26 string `msg:"field26,omitempty"`
Field27 string `msg:"field27,omitempty"`
Field28 string `msg:"field28,omitempty"`
Field29 string `msg:"field29,omitempty"`
Field30 string `msg:"field30,omitempty"`
Field31 string `msg:"field31,omitempty"`
Field32 string `msg:"field32,omitempty"`
Field33 string `msg:"field33,omitempty"`
Field34 string `msg:"field34,omitempty"`
Field35 string `msg:"field35,omitempty"`
Field36 string `msg:"field36,omitempty"`
Field37 string `msg:"field37,omitempty"`
Field38 string `msg:"field38,omitempty"`
Field39 string `msg:"field39,omitempty"`
Field40 string `msg:"field40,omitempty"`
Field41 string `msg:"field41,omitempty"`
Field42 string `msg:"field42,omitempty"`
Field43 string `msg:"field43,omitempty"`
Field44 string `msg:"field44,omitempty"`
Field45 string `msg:"field45,omitempty"`
Field46 string `msg:"field46,omitempty"`
Field47 string `msg:"field47,omitempty"`
Field48 string `msg:"field48,omitempty"`
Field49 string `msg:"field49,omitempty"`
Field50 string `msg:"field50,omitempty"`
Field51 string `msg:"field51,omitempty"`
Field52 string `msg:"field52,omitempty"`
Field53 string `msg:"field53,omitempty"`
Field54 string `msg:"field54,omitempty"`
Field55 string `msg:"field55,omitempty"`
Field56 string `msg:"field56,omitempty"`
Field57 string `msg:"field57,omitempty"`
Field58 string `msg:"field58,omitempty"`
Field59 string `msg:"field59,omitempty"`
Field60 string `msg:"field60,omitempty"`
Field61 string `msg:"field61,omitempty"`
Field62 string `msg:"field62,omitempty"`
Field63 string `msg:"field63,omitempty"`
Field64 string `msg:"field64,omitempty"`
Field65 string `msg:"field65,omitempty"`
Field66 string `msg:"field66,omitempty"`
Field67 string `msg:"field67,omitempty"`
Field68 string `msg:"field68,omitempty"`
Field69 string `msg:"field69,omitempty"`
}
type OmitEmptyNoName ¶ added in v1.2.0
type OmitEmptyNoName struct {
ABool bool `msg:",omitempty"`
AInt int `msg:",omitempty"`
AInt8 int8 `msg:",omitempty"`
AInt16 int16 `msg:",omitempty"`
AInt32 int32 `msg:",omitempty"`
AInt64 int64 `msg:",omitempty"`
AUint uint `msg:",omitempty"`
AUint8 uint8 `msg:",omitempty"`
AUint16 uint16 `msg:",omitempty"`
AUint32 uint32 `msg:",omitempty"`
AUint64 uint64 `msg:",omitempty"`
AFloat32 float32 `msg:",omitempty"`
AFloat64 float64 `msg:",omitempty"`
AComplex64 complex64 `msg:",omitempty"`
AComplex128 complex128 `msg:",omitempty"`
ANamedBool bool `msg:",omitempty"`
ANamedInt int `msg:",omitempty"`
ANamedFloat64 float64 `msg:",omitempty"`
AMapStrStr map[string]string `msg:",omitempty"`
APtrNamedStr *NamedString `msg:",omitempty"`
AString string `msg:",omitempty"`
AByteSlice []byte `msg:",omitempty"`
ASliceString []string `msg:",omitempty"`
ASliceNamedString []NamedString `msg:",omitempty"`
ANamedStruct NamedStruct `msg:",omitempty"`
APtrNamedStruct *NamedStruct `msg:",omitempty"`
AUnnamedStruct struct {
A string `msg:",omitempty"`
} `msg:",omitempty"` // omitempty not supported on unnamed struct
EmbeddableStruct `msg:",flatten,omitempty"` // embed flat
EmbeddableStruct2 `msg:",omitempty"` // embed non-flat
AArrayInt [5]int `msg:",omitempty"` // not supported
ATime time.Time `msg:",omitempty"`
}
type OmitZero0 ¶ added in v1.2.0
type OmitZero0 struct {
AStruct OmitZeroA `msg:"astruct,omitempty"` // leave this one omitempty
BStruct OmitZeroA `msg:"bstruct,omitzero"` // and compare to this
AStructPtr *OmitZeroA `msg:"astructptr,omitempty"` // a pointer case omitempty
BStructPtr *OmitZeroA `msg:"bstructptr,omitzero"` // a pointer case omitzero
AExt OmitZeroExt `msg:"aext,omitzero"` // external type case
AExtPtr *OmitZeroExtPtr `msg:"aextptr,omitzero"` // external type pointer case
// more
APtrNamedStr *NamedStringOZ `msg:"aptrnamedstr,omitzero"`
ANamedStruct NamedStructOZ `msg:"anamedstruct,omitzero"`
APtrNamedStruct *NamedStructOZ `msg:"aptrnamedstruct,omitzero"`
EmbeddableStruct `msg:",flatten,omitzero"` // embed flat
EmbeddableStructOZ `msg:"embeddablestruct2,omitzero"` // embed non-flat
ATime time.Time `msg:"atime,omitzero"`
OmitZeroTuple OmitZeroTuple `msg:"ozt"` // the inside of a tuple should ignore both omitempty and omitzero
}
type OmitZero1 ¶ added in v1.2.0
type OmitZero1 struct {
T1 OmitZeroTuple `msg:"t1"`
}
type OmitZeroA ¶ added in v1.2.0
type OmitZeroA struct {
A string `msg:"a,omitempty"`
B NamedStringOZ `msg:"b,omitzero"`
C NamedStringOZ `msg:"c,omitzero"`
}
type OmitZeroExt ¶ added in v1.2.0
type OmitZeroExt struct {
// contains filtered or unexported fields
}
func (*OmitZeroExt) DecodeMsg ¶ added in v1.2.0
func (o *OmitZeroExt) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (OmitZeroExt) EncodeMsg ¶ added in v1.2.0
func (o OmitZeroExt) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (OmitZeroExt) IsZero ¶ added in v1.2.0
func (o OmitZeroExt) IsZero() bool
IsZero will return true if a is not positive
func (OmitZeroExt) MarshalMsg ¶ added in v1.2.0
func (o OmitZeroExt) MarshalMsg(b []byte) (ret []byte, err error)
MarshalMsg implements msgp.Marshaler
func (OmitZeroExt) Msgsize ¶ added in v1.2.0
func (o OmitZeroExt) Msgsize() (s int)
Msgsize implements msgp.Msgsizer
func (*OmitZeroExt) UnmarshalMsg ¶ added in v1.2.0
func (o *OmitZeroExt) UnmarshalMsg(bts []byte) (ret []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type OmitZeroExtPtr ¶ added in v1.2.0
type OmitZeroExtPtr struct {
// contains filtered or unexported fields
}
func (*OmitZeroExtPtr) DecodeMsg ¶ added in v1.2.0
func (o *OmitZeroExtPtr) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*OmitZeroExtPtr) EncodeMsg ¶ added in v1.2.0
func (o *OmitZeroExtPtr) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*OmitZeroExtPtr) IsZero ¶ added in v1.2.0
func (o *OmitZeroExtPtr) IsZero() bool
IsZero will return true if a is nil or not positive
func (*OmitZeroExtPtr) MarshalMsg ¶ added in v1.2.0
func (o *OmitZeroExtPtr) MarshalMsg(b []byte) (ret []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*OmitZeroExtPtr) Msgsize ¶ added in v1.2.0
func (o *OmitZeroExtPtr) Msgsize() (s int)
Msgsize implements msgp.Msgsizer
func (*OmitZeroExtPtr) UnmarshalMsg ¶ added in v1.2.0
func (o *OmitZeroExtPtr) UnmarshalMsg(bts []byte) (ret []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type OmitZeroTuple ¶ added in v1.2.0
type OmitZeroTuple struct {
FieldA string `msg:"fielda,omitempty"`
FieldB NamedStringOZ `msg:"fieldb,omitzero"`
FieldC NamedStringOZ `msg:"fieldc,omitzero"`
}
OmitZeroTuple is flagged for tuple output, it should ignore all omitempty and omitzero functionality since it's fundamentally incompatible.
type Pointer0 ¶ added in v1.2.1
type Pointer0 struct {
ABool bool `msg:"abool"`
AInt int `msg:"aint"`
AInt8 int8 `msg:"aint8"`
AInt16 int16 `msg:"aint16"`
AInt32 int32 `msg:"aint32"`
AInt64 int64 `msg:"aint64"`
AUint uint `msg:"auint"`
AUint8 uint8 `msg:"auint8"`
AUint16 uint16 `msg:"auint16"`
AUint32 uint32 `msg:"auint32"`
AUint64 uint64 `msg:"auint64"`
AFloat32 float32 `msg:"afloat32"`
AFloat64 float64 `msg:"afloat64"`
AComplex64 complex64 `msg:"acomplex64"`
AComplex128 complex128 `msg:"acomplex128"`
ANamedBool bool `msg:"anamedbool"`
ANamedInt int `msg:"anamedint"`
ANamedFloat64 float64 `msg:"anamedfloat64"`
AMapStrStr map[string]string `msg:"amapstrstr"`
APtrNamedStr *NamedString `msg:"aptrnamedstr"`
AString string `msg:"astring"`
ANamedString string `msg:"anamedstring"`
AByteSlice []byte `msg:"abyteslice"`
ASliceString []string `msg:"aslicestring"`
ASliceNamedString []NamedString `msg:"aslicenamedstring"`
ANamedStruct NamedStruct `msg:"anamedstruct"`
APtrNamedStruct *NamedStruct `msg:"aptrnamedstruct"`
AUnnamedStruct struct {
A string `msg:"a"`
} `msg:"aunnamedstruct"` // omitempty not supported on unnamed struct
EmbeddableStruct `msg:",flatten"` // embed flat
EmbeddableStruct2 `msg:"embeddablestruct2"` // embed non-flat
AArrayInt [5]int `msg:"aarrayint"` // not supported
ATime time.Time `msg:"atime"`
}
type PointerHalfFull ¶ added in v1.2.1
type PointerNoName ¶ added in v1.2.1
type PointerNoName struct {
ABool bool `msg:""`
AInt int `msg:""`
AInt8 int8 `msg:""`
AInt16 int16 `msg:""`
AInt32 int32 `msg:""`
AInt64 int64 `msg:""`
AUint uint `msg:""`
AUint8 uint8 `msg:""`
AUint16 uint16 `msg:""`
AUint32 uint32 `msg:""`
AUint64 uint64 `msg:""`
AFloat32 float32 `msg:""`
AFloat64 float64 `msg:""`
AComplex64 complex64 `msg:""`
AComplex128 complex128 `msg:""`
ANamedBool bool `msg:""`
ANamedInt int `msg:""`
ANamedFloat64 float64 `msg:""`
AMapStrF map[string]NamedFloat64Pointer `msg:""`
AMapStrStruct map[string]PointerHalfFull `msg:""`
AMapStrStruct2 map[string]*PointerHalfFull `msg:""`
APtrNamedStr *NamedStringPointer `msg:""`
AString string `msg:""`
AByteSlice []byte `msg:""`
ASliceString []string `msg:""`
ASliceNamedString []NamedStringPointer `msg:""`
ANamedStruct NamedStructPointer `msg:""`
APtrNamedStruct *NamedStructPointer `msg:""`
AUnnamedStruct struct {
A string `msg:""`
} `msg:""` // omitempty not supported on unnamed struct
EmbeddableStructPointer `msg:",flatten"` // embed flat
EmbeddableStruct2Pointer `msg:""` // embed non-flat
AArrayInt [5]int `msg:""` // not supported
ATime time.Time `msg:""`
ADur time.Duration `msg:""`
}
type RegexIGNORETest ¶ added in v1.6.0
type RegexIGNORETest struct{}
func (*RegexIGNORETest) Msgsize ¶ added in v1.6.0
func (z *RegexIGNORETest) Msgsize() int
Will fail to compile if also generated
type RegexIGNSIZETest ¶ added in v1.6.0
type RegexIGNSIZETest struct{}
func (*RegexIGNSIZETest) Msgsize ¶ added in v1.6.0
func (z *RegexIGNSIZETest) Msgsize() int
Will fail to compile if also generated
type SetOf ¶ added in v1.3.0
type SetOf struct {
String setof.String
StringSorted setof.StringSorted
Int setof.Int
IntSorted setof.IntSorted
Int64 setof.Int64
Int64Sorted setof.Int64Sorted
Int32 setof.Int32
Int32Sorted setof.Int32Sorted
Int16 setof.Int16
Int16Sorted setof.Int16Sorted
Int8 setof.Int8
Int8Sorted setof.Int8Sorted
Byte setof.Byte
ByteSorted setof.ByteSorted
Uint setof.Uint
UintSorted setof.UintSorted
Uint64 setof.Uint64
Uint64Sorted setof.Uint64Sorted
Uint32 setof.Uint32
Uint32Sorted setof.Uint32Sorted
Uint16 setof.Uint16
Uint16Sorted setof.Uint16Sorted
Uint8 setof.Uint8
Uint8Sorted setof.Uint8Sorted
Float32 setof.Float32
Float32Sorted setof.Float32Sorted
Float64 setof.Float64
Float64Sorted setof.Float64Sorted
}
type SetOfTuple ¶ added in v1.3.0
type SetOfTuple struct {
String setof.String
StringSorted setof.StringSorted
Int setof.Int
IntSorted setof.IntSorted
Int64 setof.Int64
Int64Sorted setof.Int64Sorted
Int32 setof.Int32
Int32Sorted setof.Int32Sorted
Int16 setof.Int16
Int16Sorted setof.Int16Sorted
Int8 setof.Int8
Int8Sorted setof.Int8Sorted
Byte setof.Byte
ByteSorted setof.ByteSorted
Uint setof.Uint
UintSorted setof.UintSorted
Uint64 setof.Uint64
Uint64Sorted setof.Uint64Sorted
Uint32 setof.Uint32
Uint32Sorted setof.Uint32Sorted
Uint16 setof.Uint16
Uint16Sorted setof.Uint16Sorted
Uint8 setof.Uint8
Uint8Sorted setof.Uint8Sorted
Float32 setof.Float32
Float32Sorted setof.Float32Sorted
Float64 setof.Float64
Float64Sorted setof.Float64Sorted
}
type SliceString ¶ added in v1.2.0
type SliceString []String
type StandaloneBytes ¶ added in v1.6.0
type StandaloneBytes []byte
type StandaloneBytesLimited ¶ added in v1.6.0
type StandaloneBytesLimited []byte
type StructByteSlice ¶ added in v1.2.2
type StructByteSlice struct {
ABytes []byte `msg:",allownil"`
AString []string `msg:",allownil"`
ABool []bool `msg:",allownil"`
AInt []int `msg:",allownil"`
AInt8 []int8 `msg:",allownil"`
AInt16 []int16 `msg:",allownil"`
AInt32 []int32 `msg:",allownil"`
AInt64 []int64 `msg:",allownil"`
AUint []uint `msg:",allownil"`
AUint8 []uint8 `msg:",allownil"`
AUint16 []uint16 `msg:",allownil"`
AUint32 []uint32 `msg:",allownil"`
AUint64 []uint64 `msg:",allownil"`
AFloat32 []float32 `msg:",allownil"`
AFloat64 []float64 `msg:",allownil"`
AComplex64 []complex64 `msg:",allownil"`
AComplex128 []complex128 `msg:",allownil"`
AStruct []Fixed `msg:",allownil"`
}
type TestAppendTextString ¶ added in v1.6.0
type TestAppendTextString struct {
Value string `msg:"-"`
}
func (TestAppendTextString) AppendText ¶ added in v1.6.0
func (t TestAppendTextString) AppendText(dst []byte) ([]byte, error)
func (*TestAppendTextString) UnmarshalText ¶ added in v1.6.0
func (t *TestAppendTextString) UnmarshalText(text []byte) error
type TestHidden ¶
type TestStruct ¶ added in v1.6.0
type TestStruct struct {
// Direct values
BinaryValue BinaryTestType `msg:"bin_val"`
TextBinValue TextBinTestType `msg:"text_bin_val"`
TextStringValue TextStringTestType `msg:"text_str_val"`
// Pointers
BinaryPtr *BinaryTestType `msg:"bin_ptr"`
TextBinPtr *TextBinTestType `msg:"text_bin_ptr,omitempty"`
TextStringPtr *TextStringTestType `msg:"text_str_ptr,omitempty"`
// Slices
BinarySlice []BinaryTestType `msg:"bin_slice"`
TextBinSlice []TextBinTestType `msg:"text_bin_slice"`
TextStringSlice []TextStringTestType `msg:"text_str_slice"`
// Arrays
BinaryArray [3]BinaryTestType `msg:"bin_array"`
TextBinArray [2]TextBinTestType `msg:"text_bin_array"`
TextStringArray [4]TextStringTestType `msg:"text_str_array"`
// Maps with marshaler types as values
BinaryMap map[string]BinaryTestType `msg:"bin_map"`
TextBinMap map[string]TextBinTestType `msg:"text_bin_map"`
TextStringMap map[string]TextStringTestType `msg:"text_str_map"`
// Nested pointers and slices
NestedPtrSlice []*BinaryTestType `msg:"nested_ptr_slice"`
SliceOfArrays [][2]TextBinTestType `msg:"slice_of_arrays"`
MapOfSlices map[string][]BinaryTestType `msg:"map_of_slices"`
}
TestStruct contains various combinations of marshaler types
type TestTextAppenderStringPos ¶ added in v1.6.0
type TestTextAppenderStringPos struct {
Value string
}
TestTextAppenderStringPos for testing textappend with as:string positioning
func (*TestTextAppenderStringPos) AppendText ¶ added in v1.6.0
func (t *TestTextAppenderStringPos) AppendText(dst []byte) ([]byte, error)
func (*TestTextAppenderStringPos) UnmarshalText ¶ added in v1.6.0
func (t *TestTextAppenderStringPos) UnmarshalText(text []byte) error
type TestTextMarshalerStringEnd ¶ added in v1.6.0
type TestTextMarshalerStringEnd struct {
Value string
}
TestTextMarshalerStringEnd for testing as:string at end of type list
func (*TestTextMarshalerStringEnd) MarshalText ¶ added in v1.6.0
func (t *TestTextMarshalerStringEnd) MarshalText() ([]byte, error)
func (*TestTextMarshalerStringEnd) UnmarshalText ¶ added in v1.6.0
func (t *TestTextMarshalerStringEnd) UnmarshalText(text []byte) error
type TestTextMarshalerStringMiddle ¶ added in v1.6.0
type TestTextMarshalerStringMiddle struct {
Value string
}
TestTextMarshalerStringMiddle for testing as:string in middle of type list
func (*TestTextMarshalerStringMiddle) MarshalText ¶ added in v1.6.0
func (t *TestTextMarshalerStringMiddle) MarshalText() ([]byte, error)
func (*TestTextMarshalerStringMiddle) UnmarshalText ¶ added in v1.6.0
func (t *TestTextMarshalerStringMiddle) UnmarshalText(text []byte) error
type TestType ¶
type TestType struct {
F *float64 `msg:"float"`
Els map[string]string `msg:"elements"`
Obj struct {
ValueA string `msg:"value_a"`
ValueB []byte `msg:"value_b"`
} `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"`
Byte byte
Rune rune
RunePtr *rune
RunePtrPtr **rune
RuneSlice []rune
Slice1 []string
Slice2 []string
SlicePtr *[]string
MapStringEmpty map[string]struct{}
MapStringEmpty2 map[string]EmptyStruct
}
type TextAppenderBinType ¶ added in v1.6.0
type TextAppenderBinType struct {
Value string
}
TextAppenderBinType implements encoding.TextAppender (stored as binary)
func (*TextAppenderBinType) AppendText ¶ added in v1.6.0
func (t *TextAppenderBinType) AppendText(dst []byte) ([]byte, error)
func (*TextAppenderBinType) UnmarshalText ¶ added in v1.6.0
func (t *TextAppenderBinType) UnmarshalText(text []byte) error
type TextAppenderBinValue ¶ added in v1.6.0
type TextAppenderBinValue struct {
Value string `msg:"-"`
}
TextAppenderBinValue implements encoding.TextAppender (stored as binary)
func (TextAppenderBinValue) AppendText ¶ added in v1.6.0
func (t TextAppenderBinValue) AppendText(dst []byte) ([]byte, error)
func (*TextAppenderBinValue) UnmarshalText ¶ added in v1.6.0
func (t *TextAppenderBinValue) UnmarshalText(text []byte) error
type TextBinTestType ¶ added in v1.6.0
type TextBinTestType struct {
Value string
}
TextBinTestType implements encoding.TextMarshaler and encoding.TextUnmarshaler
func (*TextBinTestType) MarshalText ¶ added in v1.6.0
func (t *TextBinTestType) MarshalText() ([]byte, error)
func (*TextBinTestType) UnmarshalText ¶ added in v1.6.0
func (t *TextBinTestType) UnmarshalText(data []byte) error
type TextStringTestType ¶ added in v1.6.0
type TextStringTestType struct {
Value string
}
TextStringTestType for testing as:string option
func (*TextStringTestType) MarshalText ¶ added in v1.6.0
func (t *TextStringTestType) MarshalText() ([]byte, error)
func (*TextStringTestType) UnmarshalText ¶ added in v1.6.0
func (t *TextStringTestType) UnmarshalText(data []byte) error
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
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 TypeSample ¶ added in v1.2.4
type TypeSamples ¶ added in v1.2.4
type TypeSamples []TypeSample
type UnlimitedData ¶ added in v1.6.0
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
WeirdTag string `msg:"\x0b"`
ZCBytes []byte `msg:",zerocopy"`
ZCBytesAN []byte `msg:",zerocopy,allownil"`
ZCBytesOE []byte `msg:",zerocopy,omitempty"`
ZCBytesSlice [][]byte `msg:",zerocopy"`
ZCBytesArr [2][]byte `msg:",zerocopy"`
ZCBytesMap map[string][]byte `msg:",zerocopy"`
ZCBytesMapDeep map[string]map[string][]byte `msg:",zerocopy"`
CustomBytes CustomBytes `msg:",zerocopy"`
Renamed1 AliasedType
Renamed2 AliasedType2
Renamed3 AliasedType3
Renamed4 AliasedType4
}
tests edge-cases with compiling size compilation.
Source Files
¶
- allownil.go
- atomic.go
- binary_marshaler.go
- clearomitted.go
- compactfloats.go
- convert.go
- custom_tag.go
- def.go
- embedded_struct.go
- errorwrap.go
- field_limits.go
- generics.go
- issue102.go
- issue191.go
- issue94.go
- limits.go
- limits2.go
- map_autoshim.go
- map_bin_key.go
- map_shim_key.go
- marshal_limits.go
- newtime.go
- omitempty.go
- omitzero.go
- omitzero_ext.go
- pointer.go
- replace.go
- replace_ext.go
- setof.go
- vet_copylocks.go