Documentation ¶
Overview ¶
package `task` implements a generic task runner, which can be a source of events
Index ¶
- func KeyForPlugin(plugin iface.Plugin) string
- func NewGraph(plugins ...iface.Plugin) *graph
- func NewProvider(parent context.Context, plugins ...iface.Plugin) (iface.Provider, error)
- func NewTask(ctx context.Context, provider iface.Provider) (iface.Task, error)
- func PluginWithPath(path string) (iface.Plugin, error)
- type Plugin
- type Plugins
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyForPlugin ¶ added in v1.1.3
KeyForPlugin returns the canonical key for a plugin
func NewGraph ¶ added in v1.1.3
NewGraph creates a graph of plugins, so that dependencies can be resolved in the correct order and there are no circular references
func NewProvider ¶
Register adds a plugin to the map of plugins. It will return errors if the name or label is invalid, or the plugin with the same name already exists.
Types ¶
type Plugin ¶
type Plugin struct { Name_ types.String `json:"name,omitempty"` Label_ types.String `json:"label,omitempty"` }
Plugin creates tasks from a configuration
func (Plugin) HasNameLabel ¶
Return error if the plugin does not have a name or label
type Plugins ¶
Plugins is a map of all registered plugins
func (Plugins) LoadPluginsForPattern ¶
LoadPluginsForPattern will load and return a map of plugins for a given glob pattern, keyed against the plugin name. Any plugins which already exist are replaced, if the argument is true