lua

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateValue added in v0.3.0

func CreateValue(value any, state *lua.LState) lua.LValue

func Error added in v0.3.0

func Error(state *lua.LState, err string)

func GetValue added in v0.3.0

func GetValue(value lua.LValue) any

func LoadPlugins

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

func MapSchema added in v0.3.0

func MapSchema(schema, data map[string]any) map[string]any

func ParseEnum

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

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

func ArgVariadic added in v0.3.0

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

type ArgType

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

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) BuilderFunction added in v0.3.0

func (l *Lib) BuilderFunction(state *lua.LState, t *lua.LTable, name string, args []Arg, fn func(state *lua.LState, t *lua.LTable, args map[string]any))

func (*Lib) CreateFunction

func (l *Lib) CreateFunction(lib *lua.LTable, 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) any

func (*Lib) TableFunction added in v0.3.0

func (l *Lib) TableFunction(state *lua.LState, t *lua.LTable, name string, args []Arg, fn func(state *lua.LState, args map[string]any) int)

type PluginMap added in v0.3.0

type PluginMap map[string]func(r *Runner, lg *log.Logger)

type Runner

type Runner struct {
	State *lua.LState

	Dir        string
	Config     *config.Config
	Entry      string
	ConfigData map[string]any
	SecretData map[string]any

	Failed string

	Wg *sync.WaitGroup

	CMDParser *argparse.Parser
	CLIMode   bool

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

	// -- crates
	CR_WIN *collection.Crate[giu.MasterWindow]
	CR_REF *collection.Crate[collection.RefItem[any]]
	CR_GMP *collection.Crate[yyp.Project]
	CR_TEA *collection.Crate[teamodels.TeaItem]
	CR_LIP *collection.Crate[collection.StyleItem]
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(state *lua.LState, lg *log.Logger, cliMode bool) Runner

func (*Runner) Help added in v0.3.0

func (r *Runner) Help(file string, wf *workflow.Workflow) (string, error)

func (*Runner) Run

func (r *Runner) Run(file string, plugins PluginMap) error

func (*Runner) WorkflowConfig added in v0.3.0

func (r *Runner) WorkflowConfig(l *lua.LState, ext string) map[string]any

func (*Runner) WorkflowInfo added in v0.3.0

func (r *Runner) WorkflowInfo(name string, wf *workflow.Workflow, lg *log.Logger) *lua.LTable

func (*Runner) WorkflowInit added in v0.3.0

func (r *Runner) WorkflowInit(name string, lg *log.Logger, plugins PluginMap) *lua.LTable

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