protocol

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version
	Version byte = 'V'

	// message type
	Unknown  int = 0
	TextData int = 1
	BinData  int = 2
	PingData int = 9
	PongData int = 10

	// proto type
	Text     int = 1
	Json     int = 2
	ProtoBuf int = 3
)

Variables

This section is empty.

Functions

func GetLen

func GetLen(message []byte) int

func IsHeaderInvalid

func IsHeaderInvalid(message []byte) bool

func Pack

func Pack(route []byte, body []byte, messageType int, protoType int) []byte

func ParseMessage

func ParseMessage(bts []byte) ([]byte, []byte)

func UnPack

func UnPack(message []byte) (version byte, messageType int, protoType int, route []byte, body []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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