protocol

package
v0.0.0-...-b8b67ef Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageLengthSize = 4
	HeaderLengthSize  = 2
	VersionSize       = 4
	OperationSize     = 4
	SequenceIdSize    = 4
)
View Source
const MaxSize = int32(1 << 12)

Variables

This section is empty.

Functions

func Pack

func Pack(ctx context.Context, m *Message) []byte

Types

type Message

type Message struct {
	HeaderLen  int16
	Version    int16
	Operation  int32
	SequenceId int32
	Body       string
}

func ReadSocket

func ReadSocket(ctx context.Context, buffer *bytes.Buffer) (*Message, error)

Jump to

Keyboard shortcuts

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