Documentation ¶
Index ¶
- func Factories() map[string]Factory
- func LegacyRegister(ref string, f Factory) error
- func Register(action Action, f Factory) error
- type Action
- type AsyncAction
- type Config
- type Descriptor
- type Factory
- type Info
- type InitContext
- type Metadata
- type ResultHandler
- type Runner
- type RunnerSettable
- type SyncAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action interface { // Metadata get the Action's metadata Metadata() *Metadata // IOMetadata get the Action's IO metadata IOMetadata() *metadata.IOMetadata }
Action is an action to perform as a result of a trigger
type AsyncAction ¶
type AsyncAction interface { Action // Run this Action Run(ctx context.Context, input map[string]interface{}, handler ResultHandler) error }
AsyncAction is an asynchronous action to perform as a result of a trigger, the action can asynchronously return results as it runs. It returns immediately, but will continue to run.
type Config ¶
type Config struct { //inline action Ref string `json:"ref,omitempty"` Settings map[string]interface{} `json:"settings,omitempty"` //referenced action Id string `json:"id,omitempty"` //DEPRECATED Type string `json:"type,omitempty"` }
Config is the configuration for the Action
type Descriptor ¶
Descriptor is the descriptor for the Action
type Factory ¶
type Factory interface { // Initialize is called to initialize the action factory Initialize(ctx InitContext) error // New create a new Action New(config *Config) (Action, error) }
Factory s used to create new instances for an action
func GetFactory ¶
type InitContext ¶
type InitContext interface { // ResourceManager gets the resource manager for the app ResourceManager() *resource.Manager // ResourceManager gets the service manager for the engine ServiceManager() *service.Manager // RuntimeSettings are any runtime setting provided to the engine RuntimeSettings() map[string]interface{} }
InitContext is the initialization context for the action factory
type Metadata ¶
type Metadata struct { *metadata.IOMetadata Settings map[string]data.TypedValue }
func ToMetadata ¶
func ToMetadata(mdStructs ...interface{}) *Metadata
func (*Metadata) MarshalJSON ¶
type ResultHandler ¶
type ResultHandler interface { // HandleResult is invoked when there are results available HandleResult(results map[string]interface{}, err error) // Done indicates that the action has completed Done() }
ResultHandler used to handle results from the Action
type Runner ¶
type Runner interface { // RunAction the specified Action RunAction(ctx context.Context, act Action, input map[string]interface{}) (results map[string]interface{}, err error) }
Runner runs actions
type RunnerSettable ¶ added in v1.6.0
type RunnerSettable interface {
SetRunner(runner Runner)
}
Click to show internal directories.
Click to hide internal directories.