pluginsubtask

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

README

subtask Plugin

This plugin creates a new task. A step based on this type of action will remain incomplete until the subtask is fully DONE.

Configuration

Fields Description
template the name of a task template, as accepted through µTask's API
input a map of named values, as accepted on µTask's API
resolver_usernames a string containing a JSON array of additional resolver users for the subtask
watcher_usernames a string containing a JSON array of additional watcher users for the subtask
delay a duration indicating if subtask execution needs to be delayed, expects Golang time.Duration format (5s, 1m, ...)

Example

An action of type subtask requires the following kind of configuration:

action:
  type: subtask
  configuration:
    # a template that must already be registered on this instance of µTask
    template: another-task-template
    # valid input, as defined by the referred template
    input:
      foo: bar
    # optionally, a list of users which are authorized to resolve this specific task
    resolver_usernames: '["authorizedUser"]'
    watcher_usernames: '["authorizedUser"]'
    delay: 10m

Requirements

None.

Return

Output
Name Description
id The public identifier of the task
state The state of the task
result The result of the task
resolver_username The username of the resolver of the task
requester_username The username ot the requester of the task

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugin = taskplugin.New("subtask", "0.1", exec,
		taskplugin.WithConfig(validConfig, SubtaskConfig{}),
		taskplugin.WithContextFunc(ctx),
	)
)

the subtask plugin spawns a new µTask task, given a template and inputs an extra parameter is accepted, not available on API resolver usernames can be dynamically set for the task

Functions

This section is empty.

Types

type SubtaskConfig

type SubtaskConfig struct {
	Template          string                 `json:"template"`
	Input             map[string]interface{} `json:"input"`
	ResolverUsernames string                 `json:"resolver_usernames"`
	WatcherUsernames  string                 `json:"watcher_usernames"`
	Delay             *string                `json:"delay"`
	Tags              map[string]string      `json:"tags"`
}

SubtaskConfig is the necessary configuration to spawn a new task

type SubtaskContext

type SubtaskContext struct {
	ParentTaskID      string `json:"parent_task_id"`
	TaskID            string `json:"task_id"`
	RequesterUsername string `json:"requester_username"`
}

SubtaskContext is the metadata inherited from the "parent" task"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL