Documentation ¶
Index ¶
- func OpenSafeOs(L *lua.LState) int
- func SafeOsLoader(L *lua.LState) int
- type VM
- func (vm VM) ExecuteHealthLua(obj *unstructured.Unstructured, script string) (*appv1.HealthStatus, error)
- func (vm VM) ExecuteResourceAction(obj *unstructured.Unstructured, script string) (*unstructured.Unstructured, error)
- func (vm VM) ExecuteResourceActionDiscovery(obj *unstructured.Unstructured, script string) ([]appv1.ResourceAction, error)
- func (vm VM) GetHealthScript(obj *unstructured.Unstructured) (string, error)
- func (vm VM) GetResourceAction(obj *unstructured.Unstructured, actionName string) (appv1.ResourceActionDefinition, error)
- func (vm VM) GetResourceActionDiscovery(obj *unstructured.Unstructured) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenSafeOs ¶ added in v1.2.2
func SafeOsLoader ¶ added in v1.2.2
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 ¶
func (vm VM) ExecuteResourceAction(obj *unstructured.Unstructured, script string) (*unstructured.Unstructured, error)
func (VM) ExecuteResourceActionDiscovery ¶
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 ¶
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 ¶
func (vm VM) GetResourceActionDiscovery(obj *unstructured.Unstructured) (string, error)
Click to show internal directories.
Click to hide internal directories.