Back to godoc.org

Package then

v0.0.0-...-d221b79
Latest Go to latest

The highest tagged major version is .

Published: Oct 20, 2020 | License: Apache-2.0 | Module: github.com/byuoitav/shipwright

Index

Constants

const (
	// SlackMessageFrequency .
	SlackMessageFrequency = 4 * time.Second
)

func Add

func Add(name string, f Func)

Add .

func FillStructFromTemplate

func FillStructFromTemplate(ctx context.Context, tmpl string, fill interface{}) *nerr.E

FillStructFromTemplate .

func SendEmail

func SendEmail(ctx context.Context, with []byte, log *zap.SugaredLogger) *nerr.E

SendEmail sends an email

func SendSlack

func SendSlack(ctx context.Context, with []byte, log *zap.SugaredLogger) *nerr.E

SendSlack sends a slack message

type Email

type Email struct {
	From    string   `json:"from"`
	To      []string `json:"to"`
	Subject string   `json:"subject"`
	Body    string   `json:"body"`

	// Attachment stuff (if any)
	Attachment     []byte `json:"attachment"`
	AttachmentName string `json:"attachment-name"`

	// Auth stuff for the SMTP server
	User     string `json:"user"`
	Pass     string `json:"pass"`
	SMTPAddr string `json:"smtp-addr"`
}

Email includes information about who to send the email as, auth stuff, etc. etc.

type Func

type Func func(ctx context.Context, with []byte, log *zap.SugaredLogger) *nerr.E

Func .

func Get

func Get(name string) Func

Get .

type SlackMessage

type SlackMessage struct {
	URL        string           `json:"url"`
	Attachment slack.Attachment `json:"attachment"`
}

SlackMessage .

type Then

type Then struct {
	Do   string          `json:"do"`
	With json.RawMessage `json:"with"`
}

Then represents something to be done as a result of all of an action's If checks passing

func (*Then) Execute

func (t *Then) Execute(ctx context.Context, log *zap.SugaredLogger) *nerr.E

Execute executes a then

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier