lrp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMessageEmpty = errors.New("LRP: Cannot decode empty message")
)

Functions

This section is empty.

Types

type LRPDecoder

type LRPDecoder interface {
	Decode(msg []byte) (LRPMessage, error)
}

func NewDecoder

func NewDecoder() LRPDecoder

type LRPDecoderImpl

type LRPDecoderImpl struct{}

func (*LRPDecoderImpl) Decode

func (e *LRPDecoderImpl) Decode(msg []byte) (LRPMessage, error)

type LRPEncoder

type LRPEncoder interface {
	Encode(msg LRPMessage) []byte
}

func NewEncoder

func NewEncoder() LRPEncoder

type LRPEncoderImpl

type LRPEncoderImpl struct{}

func (*LRPEncoderImpl) Encode

func (e *LRPEncoderImpl) Encode(msg LRPMessage) []byte

type LRPMessage

type LRPMessage struct {
	OPCode  LRPOpcode
	Payload []byte
}

func NewMesssage

func NewMesssage(operation LRPOpcode, payload []byte) LRPMessage

type LRPOpcode

type LRPOpcode = int8
const (
	OprSubscribe   LRPOpcode = 0b010010 // 18
	OprUnsubscribe LRPOpcode = 0b010100 // 20
	OprAlive       LRPOpcode = 0b001010 // 10
	OprStillAlive  LRPOpcode = 0b100010 // 34
	OprLog         LRPOpcode = 0b100100 // 36
	OprErr         LRPOpcode = 0b100110 // 38
)

Jump to

Keyboard shortcuts

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