stream

package
Version: v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	Type    Type
	Padding uint16
	Payload []byte // L3 or JSON
}

Packet requires uint32be length to be prepended. The upper 8 bits of the length must be Magic

type Receiver

type Receiver struct {
	io.Reader
	sync.Mutex
}

Receiver

func (*Receiver) Recv

func (receiver *Receiver) Recv() (*Packet, error)

type Sender

type Sender struct {
	io.Writer
	sync.Mutex
}

Sender

func (*Sender) Send

func (sender *Sender) Send(p *Packet) error

type Type added in v0.2.0

type Type = uint16
const (
	Magic            = uint8(0x42)
	TypeInvalid Type = 0x0
	TypeL3      Type = 0x1
	TypeJSON    Type = 0x2
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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