slack

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NewLine is a newline character
	NewLine string = "\n"
	// Space is a space character
	Space string = " "
)
View Source
const (
	// TaskName is the name of the task this file implements
	TaskName string = "notification/slack"
)

Variables

This section is empty.

Functions

func Bold

func Bold(text string) string

Bold formats a string as bold in markdown

func Failed

func Failed(e *core.Experiment) bool

Failed returns true if the experiment has failed; false otherwise

func Italic

func Italic(text string) string

Italic formats a string as italic in markdown

func Make

func Make(t *v2alpha2.TaskSpec) (core.Task, error)

Make converts an sampletask spec into an base.Task.

func Name

func Name(e *core.Experiment) string

Name returns the name of the experiment in the form namespace/name

func SlackMessage

func SlackMessage(e *core.Experiment) string

SlackMessage constructs the slack message to post

func Stage

func Stage(e *core.Experiment) string

Stage returns the stage (status.stage) of an experiment

func Versions

func Versions(e *core.Experiment) string

Versions returns a comma separated list of version names

func Winner

func Winner(e *core.Experiment) string

Winner returns the name of the winning version, if one. Otherwise "not found"

Types

type Inputs

type Inputs struct {
	Channel       string             `json:"channel" yaml:"channel"`
	Secret        string             `json:"secret" yaml:"secret"`
	VersionInfo   []core.VersionInfo `json:"versionInfo,omitempty" yaml:"versionInfo,omitempty"`
	IgnoreFailure *bool              `json:"ignoreFailure,omitempty" yaml:"ignoreFailure,omitempty"`
}

Inputs is the object corresponding to the expcted inputs to the task

type Task

type Task struct {
	core.TaskMeta `json:",inline" yaml:",inline"`
	// If there are any additional inputs
	With Inputs `json:"with" yaml:"with"`
}

Task encapsulates a command that can be executed.

func (*Task) Run

func (t *Task) Run(ctx context.Context) error

Run the task. This suppresses all errors so that the task will always succeed. In this way, any failure does not cause failure of the enclosing experiment.

Jump to

Keyboard shortcuts

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