functions

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() []string

List returns the list of functions imported.

func LoadFromDir

func LoadFromDir(directory string) error

LoadFromDir loads recursively all the function from a given directory.

Types

type Function

type Function struct {
	Name         string                 `json:"name"`
	Action       executor.Executor      `json:"action"`
	PreHook      *executor.Executor     `json:"pre_hook,omitempty"`
	Conditions   []*condition.Condition `json:"conditions,omitempty"`
	CustomStates []string               `json:"custom_states,omitempty"`
	// contains filtered or unexported fields
}

Function describes one reusable action that can be used in steps. This function will be resolved as another function or a builtin/plugin action. Its configuration will be resolved and can takes parameters in the configuration given with templated variables under {{ .functions_args.xxx }}

func Get

func Get(name string) (*Function, bool)

Get return the function identified by the name in parameter and whether it exists.

func (*Function) Context

func (f *Function) Context(stepName string) interface{}

Context is the implementation of the runner.Context function but does nothing: function runners are just place holders to resolve to actual plugin/builtin.

func (*Function) Exec

func (f *Function) Exec(stepName string, baseConfig json.RawMessage, config json.RawMessage, ctx interface{}) (interface{}, interface{}, map[string]string, error)

Exec is the implementation of the runner.Exec function but does nothing: function runners are just place holders to resolve to actual plugin/builtin.

func (*Function) MetadataSchema

func (f *Function) MetadataSchema() json.RawMessage

MetadataSchema returns the configuration schemas of the function

func (*Function) Resources

func (f *Function) Resources(baseConfig json.RawMessage, config json.RawMessage) []string

Resources returns the resources used by the config

func (*Function) ValidConfig

func (f *Function) ValidConfig(baseConfig json.RawMessage, config json.RawMessage) error

ValidConfig insure that the given configuration resolves all the input needed by the function.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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