Documentation ¶
Index ¶
- func Actions() map[string]Actiondeprecated
- func Factories() map[string]Factory
- func Register(id string, act Action) errordeprecated
- func RegisterFactory(ref string, f Factory) error
- type Action
- func Get(id string) Actiondeprecated
- type AsyncAction
- type Config
- type Factory
- type Metadata
- type ResultHandler
- type Runner
- type SyncAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFactory ¶
Types ¶
type Action ¶
type Action interface { // Metadata get the Action's metadata Metadata() *Metadata // IOMetadata get the Action's IO metadata IOMetadata() *data.IOMetadata }
Action is an action to perform as a result of a trigger
type AsyncAction ¶
type AsyncAction interface { Action // Run this Action Run(context context.Context, inputs map[string]*data.Attribute, 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"` Settings map[string]interface{} `json:"settings"` Data json.RawMessage `json:"data"` //referenced action Id string `json:"id"` // Deprecated: No longer used Metadata *data.IOMetadata `json:"metadata"` }
Config is the configuration for the Action
type Metadata ¶
type Metadata struct { ID string `json:"ref"` Version string Settings map[string]*data.Attribute Input map[string]*data.Attribute Output map[string]*data.Attribute Async bool `json:"async"` Passthru bool `json:"passthru"` }
Metadata is the metadata for the Activity
func GetMetadata ¶
GetMetadata method to ensure we have metadata, remove in future
func NewMetadata ¶
NewMetadata creates the metadata object from its json representation
func (*Metadata) UnmarshalJSON ¶ added in v0.5.6
UnmarshalJSON overrides the default UnmarshalJSON for TaskEnv
type ResultHandler ¶
type ResultHandler interface { // HandleResult is invoked when there are results available HandleResult(results map[string]*data.Attribute, err error) // Done indicates that the action has completed Done() }
ResultHandler used to handle results from the Action
type Runner ¶
type Runner interface { // Deprecated: Use Execute() instead Run(context context.Context, act Action, uri string, options interface{}) (code int, data interface{}, err error) // Deprecated: Use Execute() instead RunAction(ctx context.Context, act Action, options map[string]interface{}) (results map[string]*data.Attribute, err error) // Execute the specified Action Execute(ctx context.Context, act Action, inputs map[string]*data.Attribute) (results map[string]*data.Attribute, err error) }
Runner runs actions
Click to show internal directories.
Click to hide internal directories.