Documentation
¶
Index ¶
- Variables
- type Lang
- func (l *Lang) Clone() *Lang
- func (l *Lang) Interactive() int
- func (l *Lang) LoadLuaPackage(name string, fn lua.LGFunction) error
- func (l *Lang) PrepareFunctions() *Lang
- func (l *Lang) RunFunction(code string, input map[string]interface{}) (output map[string]interface{}, err error)
- func (l *Lang) RunScript(filename string) int
- func (l *Lang) SetAppID(appID string)
- func (l *Lang) SetSession(sessionID string, expiresAt int64)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrApplicationNotEspecified = errors.New("Application ID not especified")
)
common errors
Functions ¶
This section is empty.
Types ¶
type Lang ¶
type Lang struct {
// contains filtered or unexported fields
}
Lang is the struct that holds all language commands
func New ¶
New returns an instance of a Lua interpreter with the backd
client inside. This allow us to integrate it in many places.
Language initialization requires a backd client with endpoints
configurated
func (*Lang) Clone ¶
Clone returns a new instance of Lang copying current configuration of
backd and Lua configuration
func (*Lang) Interactive ¶
Interactive starts the lua powered backd cli
func (*Lang) LoadLuaPackage ¶
func (l *Lang) LoadLuaPackage(name string, fn lua.LGFunction) error
LoadLuaPackage imports a package to the virtual machine
func (*Lang) PrepareFunctions ¶
PrepareFunctions executes a script file passed as argument
func (*Lang) RunFunction ¶
func (l *Lang) RunFunction(code string, input map[string]interface{}) (output map[string]interface{}, err error)
RunFunction executes the code passed as string.
every function looks for a map as input, returns a map and error (if any)
func (*Lang) SetSession ¶
SetSession sets the correct session to be used from the backd client
Click to show internal directories.
Click to hide internal directories.