Documentation ¶
Index ¶
- Constants
- func SetRegistry(r *TypeRegistry)
- func Unmarshal(b []byte) (uint64, interface{}, error)
- func UnmarshalAs(b []byte, obj interface{}, skipFn UnknownCallbackFunc) error
- func UnmarshalAsType(b []byte, vType reflect.Type, skipFn UnknownCallbackFunc) (interface{}, error)
- func UnmarshalAsWithPos(b []byte, obj interface{}, skipFn UnknownCallbackFunc) (int, error)
- func UnmarshalCustom(b []byte, typeFn UnmarshalTypeFunc, skipFn UnknownCallbackFunc) (uint64, interface{}, error)
- func UnmarshalSpecial(b []byte, special string) (uint64, interface{}, error)
- func UnmarshalType(b []byte, typeFn UnmarshalTypeFunc) (uint64, reflect.Type, error)
- type CachedSerializable
- type GoGoMarshaler
- type GoGoSerializable
- type GoGoSerializableWithText
- type MarshalerTo
- type PayloadDigesterFunc
- type Serializable
- type SerializableFromReader
- type TypeRegistry
- func (p *TypeRegistry) Get(id uint64) reflect.Type
- func (p *TypeRegistry) GetPayloadDigester(id uint64) cryptkit.DataDigester
- func (p *TypeRegistry) GetSpecial(id uint64, special string) reflect.Type
- func (p *TypeRegistry) Put(id uint64, t reflect.Type)
- func (p *TypeRegistry) PutSpecial(id uint64, special string, t reflect.Type)
- func (p *TypeRegistry) SetDefaultPayloadDigester(d cryptkit.DataDigester)
- func (p *TypeRegistry) SetPayloadDigester(id uint64, d cryptkit.DataDigester)
- func (p *TypeRegistry) UnsetPayloadDigester(id uint64)
- type UnknownCallbackFunc
- type UnmarshalTypeFunc
Constants ¶
View Source
const MaxTwoByteField = 2047
View Source
const MessageFirstField = 1800
View Source
const MessageRecordField = RecordBodyField
View Source
const MessageRecordPayloadsField = 17 // MUST be immediately after 16
View Source
const RecordBodyField = 19
View Source
const RecordBodyTagSize = 2
View Source
const RecordFirstField = 20
View Source
const RecordLastField = MaxTwoByteField - 256 // 1791
Variables ¶
This section is empty.
Functions ¶
func SetRegistry ¶
func SetRegistry(r *TypeRegistry)
func UnmarshalAs ¶
func UnmarshalAs(b []byte, obj interface{}, skipFn UnknownCallbackFunc) error
func UnmarshalAsType ¶
func UnmarshalAsType(b []byte, vType reflect.Type, skipFn UnknownCallbackFunc) (interface{}, error)
func UnmarshalAsWithPos ¶
func UnmarshalAsWithPos(b []byte, obj interface{}, skipFn UnknownCallbackFunc) (int, error)
func UnmarshalCustom ¶
func UnmarshalCustom(b []byte, typeFn UnmarshalTypeFunc, skipFn UnknownCallbackFunc) (uint64, interface{}, error)
func UnmarshalSpecial ¶
func UnmarshalType ¶
Types ¶
type CachedSerializable ¶
type CachedSerializable struct {
// contains filtered or unexported fields
}
func NewCachedSerializable ¶
func NewCachedSerializable(s Serializable, fn func([]byte)) CachedSerializable
func (*CachedSerializable) Marshal ¶
func (p *CachedSerializable) Marshal() ([]byte, error)
func (*CachedSerializable) MarshalTo ¶
func (p *CachedSerializable) MarshalTo(b []byte) (int, error)
func (*CachedSerializable) ProtoSize ¶
func (p *CachedSerializable) ProtoSize() int
func (*CachedSerializable) Unmarshal ¶
func (p *CachedSerializable) Unmarshal(b []byte) error
type GoGoMarshaler ¶
type GoGoSerializable ¶
type GoGoSerializable interface { GoGoMarshaler // contains filtered or unexported methods }
type GoGoSerializableWithText ¶
type GoGoSerializableWithText interface { GoGoSerializable encoding.TextMarshaler }
type MarshalerTo ¶
type MarshalerTo interface { proto.ProtoSizer MarshalTo([]byte) (int, error) }
type PayloadDigesterFunc ¶
type PayloadDigesterFunc = func(uint64) cryptkit.DataDigester
type Serializable ¶
type Serializable interface { proto.ProtoSizer Marshal() ([]byte, error) // contains filtered or unexported methods }
type SerializableFromReader ¶
type SerializableFromReader struct {
// contains filtered or unexported fields
}
func NewSerializableFromReader ¶
func NewSerializableFromReader(s io.Reader, dataSize int) SerializableFromReader
func (*SerializableFromReader) Marshal ¶
func (p *SerializableFromReader) Marshal() (b []byte, err error)
func (*SerializableFromReader) MarshalTo ¶
func (p *SerializableFromReader) MarshalTo(b []byte) (n int, err error)
func (*SerializableFromReader) ProtoSize ¶
func (p *SerializableFromReader) ProtoSize() int
func (*SerializableFromReader) Unmarshal ¶
func (p *SerializableFromReader) Unmarshal([]byte) error
type TypeRegistry ¶
type TypeRegistry struct {
// contains filtered or unexported fields
}
func GetRegistry ¶
func GetRegistry() *TypeRegistry
func (*TypeRegistry) GetPayloadDigester ¶
func (p *TypeRegistry) GetPayloadDigester(id uint64) cryptkit.DataDigester
func (*TypeRegistry) GetSpecial ¶
func (p *TypeRegistry) GetSpecial(id uint64, special string) reflect.Type
func (*TypeRegistry) PutSpecial ¶
func (p *TypeRegistry) PutSpecial(id uint64, special string, t reflect.Type)
func (*TypeRegistry) SetDefaultPayloadDigester ¶
func (p *TypeRegistry) SetDefaultPayloadDigester(d cryptkit.DataDigester)
func (*TypeRegistry) SetPayloadDigester ¶
func (p *TypeRegistry) SetPayloadDigester(id uint64, d cryptkit.DataDigester)
func (*TypeRegistry) UnsetPayloadDigester ¶
func (p *TypeRegistry) UnsetPayloadDigester(id uint64)
type UnknownCallbackFunc ¶
UnknownCallbackFunc handles unknown field during unmarshalling. This func can return: - positive value to indicate that size of the field - zero to use default skip behavior - negative value to ignore all further fields
type UnmarshalTypeFunc ¶
Click to show internal directories.
Click to hide internal directories.