Documentation ¶
Index ¶
- func Activities() map[string]Activity
- func CleanupSingletons()
- func GetLogger(ref string) log.Logger
- func GetRef(activity Activity) string
- func HasLegacyActivities() bool
- func IsLegacyActivity(ref string) bool
- func IsSingleton(activity Activity) bool
- func LegacyRegister(ref string, activity Activity) error
- func Register(activity Activity, f ...Factory) error
- type Activity
- type AsyncActivity
- type Config
- type Context
- type Details
- type Error
- type Factory
- type HasDetails
- type Host
- type InitContext
- type LegacyCtx
- type Metadata
- type SchemaConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Activities ¶ added in v1.1.0
func CleanupSingletons ¶
func CleanupSingletons()
func IsSingleton ¶
Types ¶
type Activity ¶
type Activity interface { // Metadata returns the metadata of the activity Metadata() *Metadata // Eval is called when an Activity is being evaluated. Returning true indicates // that the task is done. Eval(ctx Context) (done bool, err error) }
Activity is an interface for defining a custom Activity Execution
type AsyncActivity ¶
type AsyncActivity interface { Activity // PostEval is called when a activity that didn't complete during the Eval // needs to be notified. Returning true indicates that the activity is done. PostEval(context Context, userData interface{}) (done bool, err error) }
AsyncActivity is an interface for defining a custom Task that supports asynchronous callback
type Config ¶
type Config struct { Ref string `json:"ref"` Settings map[string]interface{} `json:"settings,omitempty"` Input map[string]interface{} `json:"input,omitempty"` Output map[string]interface{} `json:"output,omitempty"` Schemas *SchemaConfig `json:"schemas,omitempty"` //DEPRECATED Type string `json:"type,omitempty"` }
type Context ¶
type Context interface { // ActivityHost gets the "host" under with the activity is executing ActivityHost() Host //Name the name of the activity that is currently executing Name() string // GetInput gets the value of the specified input attribute GetInput(name string) interface{} // SetOutput sets the value of the specified output attribute SetOutput(name string, value interface{}) error // GetInputObject gets all the activity input as the specified object. GetInputObject(input data.StructValue) error // SetOutputObject sets the activity output as the specified object. SetOutputObject(output data.StructValue) error // of the data dependent on the activity host implementation GetSharedTempData() map[string]interface{} // Logger the logger for the activity Logger() log.Logger // GetTracingContext returns tracing context associated with the activity GetTracingContext() trace.TracingContext }
Context describes the execution context for an Activity. It provides access to attributes, task and Flow information.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an activity error
func NewRetriableError ¶ added in v0.9.4
type Factory ¶
type Factory func(ctx InitContext) (Activity, error)
type HasDetails ¶
type HasDetails interface {
Details() *Details
}
type Host ¶
type Host interface { // ID returns the ID of the Activity Host ID() string // Name the name of the Activity Host Name() string // IOMetadata get the input/output metadata of the activity host IOMetadata() *metadata.IOMetadata // Reply is used to reply to the activity Host with the results of the execution Reply(replyData map[string]interface{}, err error) // Return is used to indicate to the activity Host that it should complete and return the results of the execution Return(returnData map[string]interface{}, err error) // Scope returns the scope for the Host's data Scope() data.Scope }
type InitContext ¶
type InitContext interface { // Settings Settings() map[string]interface{} // MapperFactory gets the mapper factory associated with the activity host MapperFactory() mapper.Factory // Logger logger to using during initialization, activity implementations should not // keep a reference to this Logger() log.Logger }
type Metadata ¶
type Metadata struct { *metadata.IOMetadata Settings map[string]data.TypedValue }
func ToMetadata ¶
func ToMetadata(mdStructs ...interface{}) *Metadata
func (*Metadata) UnmarshalJSON ¶
UnmarshalJSON overrides the default UnmarshalJSON for TaskEnv
type SchemaConfig ¶
Click to show internal directories.
Click to hide internal directories.