Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = 1 ContentTypeProtobuf = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface {
// Pack encode source message by *Packet object
Pack(packet *Packet, data any) ([]byte, error)
// Unpack decode source message into *Packet object
Unpack(packet *Packet, msg []byte) error
}
Codec represents a interface that pack/unpack source message
type DefaultCodec ¶
type DefaultCodec struct {
// contains filtered or unexported fields
}
type Options ¶
type Options struct {
// ContentType is data content type
ContentType int
// contains filtered or unexported fields
}
Options represents codec options
Click to show internal directories.
Click to hide internal directories.