protocol

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalPacket

func MarshalPacket(packet []byte) ([]byte, error)

MarshalPacket takes in raw packet data and creates a messagepack to send

Types

type Decoder

type Decoder struct {
	Reader  *bufio.Reader
	Decoder *msgpack.Decoder
}

func StreamDecoder

func StreamDecoder(reader io.Reader) *Decoder

func (*Decoder) Decode

func (decoder *Decoder) Decode() (*Protocol, error)

DecodeStream returns a channel of protocols from a reader

type Protocol

type Protocol struct {
	Version int
	Error   string
	Packet  []byte
	// contains filtered or unexported fields
}

Protocol is a super simple client/server protocol for passing packets over messagepack

Jump to

Keyboard shortcuts

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