netstring

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEPARATOR_SYMBOL byte = ':'
	END_SYMBOL       byte = ','

	BUFFER_SIZE int = 1024

	PARSE_LENGTH State = iota
	PARSE_SEPARATOR
	PARSE_DATA
	PARSE_END
)

Variables

This section is empty.

Functions

func Encode

func Encode(payload []byte) (raw []byte)

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder() *Decoder

func (*Decoder) Feed

func (decoder *Decoder) Feed(data []byte)

Feed New incoming parsedData packets are feeded into the decoder using this method. Call this method every time we have a new set of parsedData.

func (*Decoder) Length

func (decoder *Decoder) Length() int

func (*Decoder) Reset

func (decoder *Decoder) Reset()

func (*Decoder) Result

func (decoder *Decoder) Result() chan []byte

type State

type State int

Jump to

Keyboard shortcuts

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