lua

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPlugins

func LoadPlugins(to string, r *Runner, lg *log.Logger, plugins map[string]func(r *Runner, lg *log.Logger), reqs []string, state *lua.LState)

func ParseEnum

func ParseEnum[T constraints.Integer](enum int, enums []T, lib *Lib) T

func WorkflowConfigState

func WorkflowConfigState(wf *workflow.Workflow, lg *log.Logger) *lua.LState

func WorkflowRunState

func WorkflowRunState(lg *log.Logger) *lua.LState

Types

type Arg

type Arg struct {
	Type     ArgType
	Name     string
	Optional bool
	Table    *[]Arg
}

func ArgArray

func ArgArray(name string, arrType ArrayType, optional bool) Arg

type ArgType

type ArgType int
const (
	INT ArgType = iota
	FLOAT
	BOOL
	STRING
	TABLE
	ARRAY
	ANY
	FUNC
)

type ArrayType

type ArrayType struct {
	Type  ArgType
	Table *[]Arg
}

type Lib

type Lib struct {
	Lib    string
	Runner *Runner
	State  *lua.LState
	Lg     *log.Logger
}

func NewLib

func NewLib(lib string, runner *Runner, state *lua.LState, lg *log.Logger) (*Lib, *lua.LTable)

func (*Lib) CreateFunction

func (l *Lib) CreateFunction(lib lua.LValue, name string, args []Arg, fn func(state *lua.LState, d TaskData, args map[string]any) int)

func (*Lib) ParseArgs

func (l *Lib) ParseArgs(state *lua.LState, name string, args []Arg, ln, level int) (map[string]any, int)

func (*Lib) ParseValue

func (l *Lib) ParseValue(state *lua.LState, pos int, value lua.LValue, arg Arg, argMap map[string]any) map[string]any

type Runner

type Runner struct {
	State *lua.LState

	Plugins []string
	Dir     string

	// -- collections
	TC *collection.Collection[collection.ItemTask]
	IC *collection.Collection[collection.ItemImage]
	FC *collection.Collection[collection.ItemFile]
	CC *collection.Collection[collection.ItemContext]
	QR *collection.Collection[collection.ItemQR]

	// -- crates
	CR_WIN *collection.Crate[giu.MasterWindow]
	CR_REF *collection.Crate[collection.RefItem[any]]
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(plugins []string, state *lua.LState, lg *log.Logger) Runner

func (*Runner) Run

func (r *Runner) Run(file string) error

type TaskData

type TaskData struct {
	Lib  string
	Name string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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