then

package
Version: v0.0.0-...-d221b79 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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

Types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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