websocket

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const HeadLen = 16

Variables

View Source
var PingMessage = []byte{0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
View Source
var PongMessage = []byte{0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}

Functions

This section is empty.

Types

type DefaultProtocol

type DefaultProtocol struct{}

func (*DefaultProtocol) Decode

func (p *DefaultProtocol) Decode(message []byte) (messageType byte, id int64, route []byte, body []byte)

func (*DefaultProtocol) Encode

func (p *DefaultProtocol) Encode(messageType byte, id int64, route []byte, body []byte) []byte

func (*DefaultProtocol) Reader

func (p *DefaultProtocol) Reader() func(n int, buf []byte, fn func(bytes []byte)) error

type Protocol

type Protocol interface {
	Decode(message []byte) (messageType byte, id int64, route []byte, body []byte)
	Encode(messageType byte, id int64, route []byte, body []byte) []byte
	Reader() func(n int, buf []byte, fn func(bytes []byte)) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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