Documentation
¶
Index ¶
- Variables
- func NewLengthFieldBasedFromDecoder(conn net.Conn, offset int) net.Conn
- func NewWebsocketClientDecoder(conn net.Conn) *websocketDecoder
- func NewWebsocketDecoder(conn net.Conn) net.Conn
- type Codec
- type JsonCodec
- type LengthFieldBasedFrameDecoder
- type Options
- type Packet
- func (p *Packet) Encode(data any) (msg []byte, err error)
- func (p *Packet) EncodeWith(action, seq int16, data any) ([]byte, error)
- func (p *Packet) Marshal(data any) (err error)
- func (p *Packet) Pack() ([]byte, error)
- func (p *Packet) Unmarshal(data any) (err error)
- func (p *Packet) Unpack(msg []byte) error
- type ProtoCodec
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidProtoMessage = errors.New("invalid proto message")
)
Functions ¶
func NewLengthFieldBasedFromDecoder ¶ added in v0.1.6
func NewWebsocketClientDecoder ¶ added in v0.1.6
Types ¶
type JsonCodec ¶ added in v0.1.5
type JsonCodec struct { }
func NewJsonCodec ¶ added in v0.1.5
func NewJsonCodec() *JsonCodec
type LengthFieldBasedFrameDecoder ¶ added in v0.1.6
func (*LengthFieldBasedFrameDecoder) Read ¶ added in v0.1.6
func (decoder *LengthFieldBasedFrameDecoder) Read(bytes []byte) (n int, err error)
func (*LengthFieldBasedFrameDecoder) SyscallConn ¶ added in v0.1.6
func (c *LengthFieldBasedFrameDecoder) SyscallConn() (syscall.RawConn, error)
SyscallConn prepare for epoll
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options represents options options
func DefaultOptions ¶ added in v0.1.5
func DefaultOptions() *Options
Default returns the default options implementation,the packet is composed by : |-------------- header --------------|-------- body --------| |packetLength| action | seq |-------- body --------| | 4 | 2 | 2 | n |
type Packet ¶
func (*Packet) EncodeWith ¶ added in v0.1.7
type ProtoCodec ¶ added in v0.1.5
type ProtoCodec struct { }
func NewProtoCodec ¶ added in v0.1.5
func NewProtoCodec() *ProtoCodec
Click to show internal directories.
Click to hide internal directories.