Documentation ¶
Overview ¶
Package slack handles interfacing with the Slack API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSlackComplete ¶
IsSlackComplete once a slack status has reached any of these states it will require no more updates.
Types ¶
type Slacker ¶
type Slacker interface { PostMessage(options ...slack.MsgOption) error PostMessageToUser(user *slack.User, options ...slack.MsgOption) error LookupUser(email string) (*slack.User, bool) }
Slacker represents a type that can interact with the Slack API.
type Status ¶
type Status string
Status represents which lifecycle stage a cluster has most recently sent a slack message for.
const ( // StatusSkip is for when cluster should not result in Slack messages. StatusSkip Status = "skip" // StatusFailed is for when a cluster has failed. StatusFailed Status = "failed" // StatusDestroyed is for when a cluster is being deleted. StatusDestroyed Status = "destroyed" // StatusReady is for when a cluster is ready. StatusReady Status = "ready" // StatusNearingExpiry is for when a cluster is close to expiry. StatusNearingExpiry Status = "nearing_expiry" // StatusCreating is for when a cluster is being created. StatusCreating Status = "creating" )
func FormatSlackMessage ¶
func FormatSlackMessage(wfStatus v1.Status, clusterIsNearingExpiry bool, slackStatus Status, contextData TemplateData) (Status, []slack.MsgOption)
FormatSlackMessage formats the correct Slack message given the current cluster state.
Click to show internal directories.
Click to hide internal directories.