rmsreg

package
v0.0.0-...-05bc493 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 Unmarshal

func Unmarshal(b []byte) (uint64, interface{}, error)

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 UnmarshalSpecial(b []byte, special string) (uint64, interface{}, error)

func UnmarshalType

func UnmarshalType(b []byte, typeFn UnmarshalTypeFunc) (uint64, reflect.Type, error)

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 GoGoMarshaler interface {
	proto.ProtoSizer
	MarshalTo([]byte) (int, error)
	MarshalToSizedBuffer([]byte) (int, error)
}

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) Get

func (p *TypeRegistry) Get(id uint64) reflect.Type

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) Put

func (p *TypeRegistry) Put(id uint64, t 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

type UnknownCallbackFunc = func([]byte) (int, error)

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

type UnmarshalTypeFunc = func(uint64) reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL