scripts

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 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 Engine

type Engine interface {
	Compile() (err error)
	PushStruct(name string, i interface{})
	PushFunction(name string, i interface{})
	EvalString(str ...string) (result string, errs error)
	EvalScript(script *m.Script) (result string, err error)
	DoFull() (res string, err error)
	Do() (string, error)
	AssertFunction(f string, arg ...interface{}) (result string, err error)
	Print(v ...interface{})
	Get() IScript
	File(path string) ([]byte, error)
	ScriptId() int64
	Script() *m.Script
}

type EngineWatcher

type EngineWatcher interface {
	Stop()
	Spawn(f func(engine Engine))
	BeforeSpawn(f func(engine Engine))
	Engine() Engine
	PushStruct(name string, str interface{})
	PopStruct(name string)
	PushFunction(name string, f interface{})
	PopFunction(name string)
}

type EnginesWatcher

type EnginesWatcher interface {
	Stop()
	Spawn(f func(engine Engine))
	BeforeSpawn(f func(engine Engine))
	Engine() Engine
	AssertFunction(f string, arg ...interface{}) (result string, err error)
	PushStruct(name string, str interface{})
	PopStruct(name string)
	PushFunction(name string, f interface{})
	PopFunction(name string)
}

type IScript

type IScript interface {
	Init() error
	Do() (string, error)
	AssertFunction(string, ...interface{}) (string, error)
	Compile() error
	PushStruct(string, interface{})
	PushFunction(string, interface{})
	EvalString(string) (string, error)
	CreateProgram(name, source string) (err error)
	RunProgram(name string) (result string, err error)
}

IScript ...

type ScriptService

type ScriptService interface {
	NewEngine(s *m.Script) (Engine, error)
	NewEngineWatcher(*m.Script) (EngineWatcher, error)
	NewEnginesWatcher([]*m.Script) (EnginesWatcher, error)
	PushStruct(name string, s interface{})
	PopStruct(name string)
	PushFunctions(name string, s interface{})
	PopFunction(name string)
	Restart()
}

ScriptService ...

Jump to

Keyboard shortcuts

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