engine

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	DebugMode bool
	// contains filtered or unexported fields
}

The Engine is the processing logic of the hash server

func New

func New() *Engine

New creates a new engine

func (*Engine) GetVariable

func (e *Engine) GetVariable(name string) []byte

GetVariable returns the value of a variable in the engine

func (*Engine) Help

func (e *Engine) Help() []byte

Help returns some basic help about the commands

func (*Engine) Log

func (e *Engine) Log(parms ...interface{})

Log writes information to the debug log

func (*Engine) LogStack

func (e *Engine) LogStack()

func (*Engine) LogValues

func (e *Engine) LogValues()

func (*Engine) Logf

func (e *Engine) Logf(format string, parms ...interface{})

Logf writes formatted information to the debug log

func (*Engine) PushStack

func (e *Engine) PushStack(value []byte)

PushStack is used to intialize the stack of the engine. It is typically used to set the initial value to operate on.

func (*Engine) Reset

func (e *Engine) Reset()

Reset returns the engine to the initial state

func (*Engine) Run

func (e *Engine) Run(commands []string) ([]byte, error)

Run executes the logic of the engine, returning the last value from the stack.

func (*Engine) SetVariable

func (e *Engine) SetVariable(name string, value []byte)

SetVariable sets a variable for the engine to use

type Stack

type Stack list.List

func NewStack

func NewStack() *Stack

func (*Stack) Len

func (stack *Stack) Len() int

func (*Stack) Pop

func (stack *Stack) Pop() []byte

func (*Stack) PopInt

func (stack *Stack) PopInt() (int, error)

func (*Stack) PopString

func (stack *Stack) PopString() (string, error)

func (*Stack) Push

func (stack *Stack) Push(data []byte)

func (*Stack) ToArray

func (stack *Stack) ToArray() [][]byte

func (*Stack) Top

func (stack *Stack) Top() []byte

Jump to

Keyboard shortcuts

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