user

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFunction added in v1.1.0

func DeleteFunction(name string)

Delete user function with name.

func DeleteFunctionVariant added in v1.2.0

func DeleteFunctionVariant(name string, idx int)

Delete user function variant by id.

func DeleteVariable added in v1.1.0

func DeleteVariable(name string)

Delete user variable with given name.

func DropFunctions added in v1.1.0

func DropFunctions()

Delete all user defined functions.

func DropVariables added in v1.1.0

func DropVariables()

Delete all user variables.

func GetVariable added in v1.1.0

func GetVariable(name string) (val interface{}, found bool)

Get user variable with given name.

func HasFunction added in v1.1.0

func HasFunction(name string) bool

Is function presented in the user functions map.

func HasVariable added in v1.1.0

func HasVariable(name string) bool

Is variable with name presented in the user variables map.

func ListFunctions added in v1.1.0

func ListFunctions() map[string]Func

Return the user function map.

func ListVariables added in v1.1.0

func ListVariables() map[string]interface{}

Return the user variables map.

func Predict added in v1.4.0

func Predict(word string) string

func SetFunction added in v1.1.0

func SetFunction(name string, function Func)

Set user function with given name.

func SetFunctionVariant added in v1.1.0

func SetFunctionVariant(name string, variant FuncVariant)

Set function varian for the funtion with given name.

func SetVariable added in v1.1.0

func SetVariable(name string, val interface{})

Set user variable with name and value.

Types

type Func

type Func struct {
	Variants []FuncVariant
}

func GetFunction added in v1.1.0

func GetFunction(name string) (function Func, found bool)

Get user function by name from the user functions map.

type FuncVariant added in v1.1.0

type FuncVariant struct {
	Args []utils.Word
	Body []utils.Word
}

func (FuncVariant) ArgNames added in v1.1.0

func (v FuncVariant) ArgNames() (pos []string)

Return argument names of function variant as strings slice.

func (FuncVariant) String added in v1.1.0

func (v FuncVariant) String() string

fmt.Stringer interface implementation.

Jump to

Keyboard shortcuts

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