lua

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenSafeOs added in v1.2.2

func OpenSafeOs(L *lua.LState) int

func SafeOsLoader added in v1.2.2

func SafeOsLoader(L *lua.LState) int

Types

type VM

type VM struct {
	ResourceOverrides map[string]appv1.ResourceOverride
	// UseOpenLibs flag to enable open libraries. Libraries are always disabled while running, but enabled during testing to allow the use of print statements
	UseOpenLibs bool
}

VM Defines a struct that implements the luaVM

func (VM) ExecuteHealthLua

func (vm VM) ExecuteHealthLua(obj *unstructured.Unstructured, script string) (*appv1.HealthStatus, error)

ExecuteHealthLua runs the lua script to generate the health status of a resource

func (VM) ExecuteResourceAction added in v1.0.0

func (vm VM) ExecuteResourceAction(obj *unstructured.Unstructured, script string) (*unstructured.Unstructured, error)

func (VM) ExecuteResourceActionDiscovery added in v1.0.0

func (vm VM) ExecuteResourceActionDiscovery(obj *unstructured.Unstructured, script string) ([]appv1.ResourceAction, error)

func (VM) GetHealthScript

func (vm VM) GetHealthScript(obj *unstructured.Unstructured) (string, error)

GetHealthScript attempts to read lua script from config and then filesystem for that resource

func (VM) GetResourceAction added in v1.0.0

func (vm VM) GetResourceAction(obj *unstructured.Unstructured, actionName string) (appv1.ResourceActionDefinition, error)

GetResourceAction attempts to read lua script from config and then filesystem for that resource

func (VM) GetResourceActionDiscovery added in v1.0.0

func (vm VM) GetResourceActionDiscovery(obj *unstructured.Unstructured) (string, error)

Jump to

Keyboard shortcuts

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