Documentation ¶
Overview ¶
Package codec provides methods allowing to encode and decode message structs to/from binary format accepted by VPP.
Index ¶
- Variables
- func DecodeMsg(data []byte, msg api.Message) (err error)
- func DecodeMsgContext(data []byte, msgType api.MessageType) (context uint32, err error)
- func EncodeMsg(msg api.Message, msgID uint16) (data []byte, err error)
- type Buffer
- func (b *Buffer) Bytes() []byte
- func (b *Buffer) DecodeBool() bool
- func (b *Buffer) DecodeBytes(length int) []byte
- func (b *Buffer) DecodeFloat64() float64
- func (b *Buffer) DecodeInt16() int16
- func (b *Buffer) DecodeInt32() int32
- func (b *Buffer) DecodeInt64() int64
- func (b *Buffer) DecodeInt8() int8
- func (b *Buffer) DecodeString(length int) string
- func (b *Buffer) DecodeUint16() uint16
- func (b *Buffer) DecodeUint32() uint32
- func (b *Buffer) DecodeUint64() uint64
- func (b *Buffer) DecodeUint8() uint8
- func (b *Buffer) EncodeBool(v bool)
- func (b *Buffer) EncodeBytes(v []byte, length int)
- func (b *Buffer) EncodeFloat64(v float64)
- func (b *Buffer) EncodeInt16(v int16)
- func (b *Buffer) EncodeInt32(v int32)
- func (b *Buffer) EncodeInt64(v int64)
- func (b *Buffer) EncodeInt8(v int8)
- func (b *Buffer) EncodeString(v string, length int)
- func (b *Buffer) EncodeUint16(v uint16)
- func (b *Buffer) EncodeUint32(v uint32)
- func (b *Buffer) EncodeUint64(v uint64)
- func (b *Buffer) EncodeUint8(v uint8)
- type Marshaler
- type MsgCodec
- type Unmarshaler
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCodec = new(MsgCodec)
Functions ¶
func DecodeMsgContext ¶
func DecodeMsgContext(data []byte, msgType api.MessageType) (context uint32, err error)
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer provides buffer for encoding and decoding data on wire.
func (*Buffer) DecodeBool ¶
func (*Buffer) DecodeBytes ¶
func (*Buffer) DecodeFloat64 ¶
func (*Buffer) DecodeInt16 ¶
func (*Buffer) DecodeInt32 ¶
func (*Buffer) DecodeInt64 ¶
func (*Buffer) DecodeInt8 ¶
func (*Buffer) DecodeString ¶
func (*Buffer) DecodeUint16 ¶
func (*Buffer) DecodeUint32 ¶
func (*Buffer) DecodeUint64 ¶
func (*Buffer) DecodeUint8 ¶
func (*Buffer) EncodeBool ¶
func (*Buffer) EncodeBytes ¶
func (*Buffer) EncodeFloat64 ¶
func (*Buffer) EncodeInt16 ¶
func (*Buffer) EncodeInt32 ¶
func (*Buffer) EncodeInt64 ¶
func (*Buffer) EncodeInt8 ¶
func (*Buffer) EncodeString ¶
func (*Buffer) EncodeUint16 ¶
func (*Buffer) EncodeUint32 ¶
func (*Buffer) EncodeUint64 ¶
func (*Buffer) EncodeUint8 ¶
type Marshaler ¶
Marshaler is the interface implemented by the binary API messages that can marshal itself into binary form for the wire.
type MsgCodec ¶
type MsgCodec struct{}
MsgCodec provides encoding and decoding functionality of `api.Message` structs into/from binary format as accepted by VPP.
func (*MsgCodec) DecodeMsgContext ¶
type Unmarshaler ¶
Unmarshaler is the interface implemented by the binary API messages that can unmarshal a binary representation of itself from the wire.
Click to show internal directories.
Click to hide internal directories.