Documentation ¶
Index ¶
- func AppendOutput(value interface{}, path ...interface{}) error
- func MustAppendOutput(value interface{}, path ...interface{})
- func MustNamedOutput(name string, value interface{})deprecated
- func MustOutput(value interface{})deprecated
- func MustSetOutput(value interface{}, path ...interface{})
- func NamedOutput(name string, value interface{}) errordeprecated
- func Output(value interface{}) errordeprecated
- func Parameters(parameters interface{}) error
- func Run(f func(ctx context.Context) error)
- func SetOutput(value interface{}, path ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendOutput ¶ added in v0.1.0
func AppendOutput(value interface{}, path ...interface{}) error
AppendOutput appends to the Airplane task output, writing it to stdout. Optionally can be provided a JSON path to only append to part of the output. Outputs are separated from your logs and are used to provide structured context to end-users of your task.
A JSON path should consist of multiple strings and/or integers. A string indicates the value associated with a key in a JSON object, and an integer indicates the index of an element in a (0-indexed) JSON array. For instance calling
AppendOutput(4, "test", 3)
would append a 4 to the array containing a 3 in the following JSON object:
{"test": [[0], [1], [2], [3]]}
func MustAppendOutput ¶ added in v0.1.0
func MustAppendOutput(value interface{}, path ...interface{})
MustAppendOutput appends to the Airplane task output, writing it to stdout. Optionally can be provided a JSON path to only append to part of the output. Outputs are separated from your logs and are used to provide structured context to end-users of your task.
A JSON path should consist of multiple strings and/or integers. A string indicates the value associated with a key in a JSON object, and an integer indicates the index of an element in a (0-indexed) JSON array. For instance calling
MustAppendOutput(4, "test", 3)
would append a 4 to the array containing a 3 in the following JSON object:
{"test": [[0], [1], [2], [3]]}
If an error is produced, MustAppendOutput will panic.
func MustNamedOutput
deprecated
func MustNamedOutput(name string, value interface{})
MustNamedOutput writes `value` to stdout as an Airplane output. Outputs are separated from your logs and used to provide context structured context to end-users of your task. Unlike Output, NamedOutput accepts a `name` which will be used to group separate streams of outputs together.
If an error is produced, MustNamedOutput will panic.
Deprecated: Please use MustSetOutput or MustAppendOutput instead.
func MustOutput
deprecated
func MustOutput(value interface{})
MustOutput writes `value` to stdout as an Airplane output. Outputs are separated from your logs and used to provide context structured context to end-users of your task.
If an error is produced, MustOutput will panic.
Deprecated: Please use MustSetOutput or MustAppendOutput instead.
func MustSetOutput ¶ added in v0.1.0
func MustSetOutput(value interface{}, path ...interface{})
MustSetOutput sets the Airplane task output, writing it to stdout. Optionally can be provided a JSON path to only set a part of the output. Outputs are separated from your logs and are used to provide structured context to end-users of your task.
A JSON path should consist of multiple strings and/or integers. A string indicates the value associated with a key in a JSON object, and an integer indicates the index of an element in a (0-indexed) JSON array. For instance calling
MustSetOutput(4, "test", 3)
would update the 3 to a 4 in the following JSON object:
{"test": [0, 1, 2, 3]}
If an error is produced, MustSetOutput will panic.
func NamedOutput
deprecated
NamedOutput writes `value` to stdout as an Airplane output. Outputs are separated from your logs and used to provide context structured context to end-users of your task. Unlike Output, NamedOutput accepts a `name` which will be used to group separate streams of outputs together.
Deprecated: Please use SetOutput or AppendOutput instead.
func Parameters ¶
func Parameters(parameters interface{}) error
Parameters parses the CLI arguments provided to the task and sets them into `parameters` by matching JSON struct tags to parameter slugs.
This expects that the first CLI argument to your task is a JSON document containing parameter slugs mapped to parameter values. This is done by setting the `arguments` field of the task to `{{.JSON}}`.
func Run ¶
Run provides your task with context-cancellation and error-handling. Any errors returned, or bubbled up via a panic, will be logged as Airplane outputs.
Types ¶
This section is empty.