notification

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 14 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 (

	// LibraryName is the name of the task library this package implements
	LibraryName string = "notification"
)
View Source
const (
	// SlackTaskName is the name of the task this file implements
	SlackTaskName string = "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 *experiment.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 MakeSlackTask

func MakeSlackTask(t *v2alpha2.TaskSpec) (base.Task, error)

MakeSlackTask converts an sampletask spec into an base.Task.

func MakeTask

func MakeTask(t *v2alpha2.TaskSpec) (base.Task, error)

MakeTask constructs a Task from a TaskMeta or returns an error if any.

func Name

func Name(e *experiment.Experiment) string

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

func SlackMessage

func SlackMessage(e *experiment.Experiment) string

SlackMessage constructs the slack message to post

func Stage

func Stage(e *experiment.Experiment) string

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

func Versions

func Versions(e *experiment.Experiment) string

Versions returns a comma separated list of version names

func Winner

func Winner(e *experiment.Experiment) string

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

Types

type SlackTask

type SlackTask struct {
	base.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.

func (*SlackTask) Run

func (t *SlackTask) 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.

type SlackTaskInputs

type SlackTaskInputs struct {
	Channel string `json:"channel" yaml:"channel"`
	Secret  string `json:"secret" yaml:"secret"`
}

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

Jump to

Keyboard shortcuts

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