utils

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MPL-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSlicesToStrings

func ByteSlicesToStrings(bss [][]byte) []string

Types

type ByteBuffer

type ByteBuffer struct {
	Buf []byte
}

func (*ByteBuffer) Append

func (b *ByteBuffer) Append(data []byte)

func (*ByteBuffer) Get

func (b *ByteBuffer) Get(length int, consume bool) (data []byte, ok bool)

func (*ByteBuffer) GetByte

func (b *ByteBuffer) GetByte(consume bool) (byte, bool)

func (*ByteBuffer) GetString

func (b *ByteBuffer) GetString(length int, consume bool) (string, bool)

func (*ByteBuffer) GetSubBuffer

func (b *ByteBuffer) GetSubBuffer(length int, consume bool) (sub *ByteBuffer, ok bool)

func (*ByteBuffer) GetUint16

func (b *ByteBuffer) GetUint16(littleEndian, consume bool) (uint16, bool)

func (*ByteBuffer) GetUint32

func (b *ByteBuffer) GetUint32(littleEndian, consume bool) (uint32, bool)

func (*ByteBuffer) GetUntil

func (b *ByteBuffer) GetUntil(sep []byte, includeSep, consume bool) (data []byte, ok bool)

func (*ByteBuffer) Index

func (b *ByteBuffer) Index(sep []byte) int

func (*ByteBuffer) Len

func (b *ByteBuffer) Len() int

func (*ByteBuffer) Reset

func (b *ByteBuffer) Reset()

func (*ByteBuffer) Skip

func (b *ByteBuffer) Skip(length int) bool

type LSMAction

type LSMAction int
const (
	LSMActionPause LSMAction = iota
	LSMActionNext
	LSMActionReset
	LSMActionCancel
)

type LinearStateMachine

type LinearStateMachine struct {
	Steps []func() LSMAction
	// contains filtered or unexported fields
}

func NewLinearStateMachine

func NewLinearStateMachine(steps ...func() LSMAction) *LinearStateMachine

func (*LinearStateMachine) AppendSteps added in v0.0.4

func (lsm *LinearStateMachine) AppendSteps(steps ...func() LSMAction)

func (*LinearStateMachine) Reset

func (lsm *LinearStateMachine) Reset()

func (*LinearStateMachine) Run

func (lsm *LinearStateMachine) Run() (cancelled bool, done bool)

Run runs the state machine until it pauses, finishes or is cancelled.

Jump to

Keyboard shortcuts

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