Documentation
¶
Index ¶
- Constants
- func Bold(text string) string
- func Failed(e *tasks.Experiment) bool
- func Italic(text string) string
- func MakeHTTPTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakeSlackTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakeTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func Name(e *tasks.Experiment) string
- func SlackMessage(e *tasks.Experiment) string
- func Stage(e *tasks.Experiment) string
- func Versions(e *tasks.Experiment) string
- func Winner(e *tasks.Experiment) string
- type HTTPInputs
- type HTTPTask
- type Inputs
- type SlackTask
- type SlackTaskInputs
Constants ¶
const ( // NewLine is a newline character NewLine string = "\n" // Space is a space character Space string = " " )
const ( // HTTPTaskName is the name of the HTTP request task HTTPTaskName string = "http" )
const ( // LibraryName is the name of the task library this package implements LibraryName string = "notification" )
const ( // SlackTaskName is the name of the task this file implements SlackTaskName string = "slack" )
Variables ¶
This section is empty.
Functions ¶
func Failed ¶
func Failed(e *tasks.Experiment) bool
Failed returns true if the experiment has failed; false otherwise
func MakeHTTPTask ¶ added in v0.1.21
MakeHTTPTask converts an spec to a task.
func MakeSlackTask ¶
MakeSlackTask converts an sampletask spec into an base.Task.
func Name ¶
func Name(e *tasks.Experiment) string
Name returns the name of the experiment in the form namespace/name
func SlackMessage ¶
func SlackMessage(e *tasks.Experiment) string
SlackMessage constructs the slack message to post
func Stage ¶
func Stage(e *tasks.Experiment) string
Stage returns the stage (status.stage) of an experiment
func Versions ¶
func Versions(e *tasks.Experiment) string
Versions returns a comma separated list of version names
func Winner ¶
func Winner(e *tasks.Experiment) string
Winner returns the name of the winning version, if one. Otherwise "not found"
Types ¶
type HTTPInputs ¶ added in v0.1.21
type HTTPInputs struct {
URL string `json:"URL" yaml:"URL"`
Method *v2alpha2.MethodType `json:"method,omitempty" yaml:"method,omitempty"`
AuthType *v2alpha2.AuthType `json:"authType,omitempty" yaml:"authType,omitempty"`
Secret *string `json:"secret,omitempty" yaml:"secret,omitempty"`
Headers []v2alpha2.NamedValue `json:"headers,omitempty" yaml:"headers,omitempty"`
Body *string `json:"body,omitempty" yaml:"body,omitempty"`
Inputs `json:",inline" yaml:",inline"`
}
HTTPInputs contain the name and arguments of the task.
type HTTPTask ¶ added in v0.1.21
type HTTPTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
With HTTPInputs `json:"with" yaml:"with"`
}
HTTPTask encapsulates the task.
type Inputs ¶ added in v0.1.21
type Inputs struct {
IgnoreFailure *bool `json:"ignoreFailure,omitempty" yaml:"ignoreFailure,omitempty"`
}
Inputs contains inputs common to all notifations. Should be included in the indivodual input structs via inline
type SlackTask ¶
type SlackTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
// If there are any additional inputs
With SlackTaskInputs `json:"with" yaml:"with"`
}
SlackTask encapsulates a command that can be executed.
type SlackTaskInputs ¶
type SlackTaskInputs struct {
Channel string `json:"channel" yaml:"channel"`
Secret string `json:"secret" yaml:"secret"`
Inputs `json:",inline" yaml:",inline"`
}
SlackTaskInputs is the object corresponding to the expcted inputs to the task