apiserver

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeadLength    = 32
	MaxPacketSize = 64 * 1024
)

Codec constants.

Variables

View Source
var ErrPacketSizeExcced = errors.New("codec: packet size exceed")

ErrPacketSizeExcced is the error used for encode/decode.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

A Decoder reads and decodes network data slice

func NewDecoder

func NewDecoder() *Decoder

NewDecoder returns a new decoder that used for decode network bytes slice.

func (*Decoder) Decode

func (c *Decoder) Decode(data []byte) (*Packet, error)

Decode decode the network bytes slice to Packet(s) TODO(Warning): shared slice

type Packet

type Packet struct {
	Length int
	Data   map[string]interface{}
}

Packet represents a network packet.

func NewPacket

func NewPacket(data map[string]interface{}, size int) *Packet

Jump to

Keyboard shortcuts

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