Documentation ¶
Index ¶
- func FuncsInit(out io.Writer)deprecated
- func GetConstant(name string) (val interface{}, found bool)
- func HasConstant(name string) bool
- func HasFunction(name string) bool
- func ListConstants() map[string]interface{}
- func Predict(word string) string
- func RegisterConstant[T string | bool | uint64 | int64 | float64](name string, value T)
- func RegisterFunction(name string, function Func)
- func SystemInit(sys System)
- type Environment
- type Func
- type FuncMap
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConstant ¶ added in v1.1.0
Get constant by name from the builtin constant map.
func HasConstant ¶ added in v1.1.0
Is constant with name presented in the builtin constant map.
func HasFunction ¶ added in v1.1.0
Is function with name presented in the builtin function map.
func ListConstants ¶ added in v1.1.0
func ListConstants() map[string]interface{}
Return the builtin constant map.
func RegisterConstant ¶ added in v1.2.2
Register a new constant and add it to the builtin constant map.
func RegisterFunction ¶ added in v1.2.2
Register a new function and add it to the builtin function map.
func SystemInit ¶ added in v1.4.0
func SystemInit(sys System)
Provide your own system description.
Use this function to implement native integration into your application.
Types ¶
type Environment ¶ added in v1.4.0
type Func ¶
type Func struct { // Arguments description. Args string // Function description. Desc string // Function that will be executed. Exec func(args ...interface{}) (interface{}, error) }
func GetFunction ¶ added in v1.1.0
Get function by name from the builtin function map.
type System ¶ added in v1.4.0
type System struct { // Writer for additional output. Stdout io.Writer // Callback that should clears screen. ClearScreen func() // Random seed that sets on SystemInit. RandomSeed int64 // Callback that should return list of available environment file names. ListEnvironments func() ([]string, error) // Callback that should open environment file with provided name for write and return it as io.WriteCloser. WriteEnvironment func(name string) (io.WriteCloser, error) // Callback that should open environment file with provided name for read and return it as io.ReadCloser. ReadEnvironment func(name string) (io.ReadCloser, error) }
Click to show internal directories.
Click to hide internal directories.