Documentation
¶
Index ¶
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
}
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
Click to show internal directories.
Click to hide internal directories.