Documentation ¶
Index ¶
- func List() []string
- func LoadFromDir(directory string) error
- type Function
- func (f *Function) Context(stepName string) interface{}
- func (f *Function) Exec(stepName string, baseConfig json.RawMessage, config json.RawMessage, ...) (interface{}, interface{}, map[string]string, error)
- func (f *Function) MetadataSchema() json.RawMessage
- func (f *Function) Resources(baseConfig json.RawMessage, config json.RawMessage) []string
- func (f *Function) ValidConfig(baseConfig json.RawMessage, config json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromDir ¶
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 (*Function) Context ¶
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.