stream

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interpreter

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

Interpreter interprets the message received from the client.

func NewInterpreter

func NewInterpreter() Interpreter

NewInterpreter creates a new instance of the Interpreter type.

func (Interpreter) Eval

func (i Interpreter) Eval(b []byte) Msg

Eval evalues the message sent into an appropriate Msg type.

type Kind

type Kind int8

Kind labels the allowed operation.

const (
	// Undef represents an undefined operation.
	Undef Kind = iota
	// Fnd represents the find operation.
	Fnd
	// Lst represents the list operation.
	Lst
	// Ins represents the insert operation.
	Ins
	// Del represents the delete operation.
	Del
	// Rld represents the reload operation.
	Rld
)

type Msg

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

Msg represents the evaluated client message.

func (Msg) Contents

func (m Msg) Contents() []byte

Contents returns the body of the message.

func (Msg) IsUnbound

func (m Msg) IsUnbound() bool

IsUnbound tells whether the message is unbound.

func (Msg) T

func (m Msg) T() Kind

T tells the type of the message.

func (Msg) TByte

func (m Msg) TByte() []byte

TByte returns the type of the operation as a slice of bytes.

func (Msg) TString

func (m Msg) TString() string

TString return the type of the operation as a string.

Jump to

Keyboard shortcuts

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