Documentation ¶
Index ¶
- Variables
- func ParseUserMappings(users []string) (map[string]string, error)
- func Persist(path string, message Message) error
- type BuildsOptions
- type Client
- func (c *Client) NotifyK8SDeployEvent(ctx context.Context, event NotifyK8sDeployOptions) error
- func (c *Client) NotifyK8SJobErrorEvent(ctx context.Context, event *http.JobErrorEvent) error
- func (c *Client) NotifyK8SPodErrorEvent(ctx context.Context, event *http.PodErrorEvent) error
- func (c *Client) NotifyRelease(ctx context.Context, releaseOptions ReleaseOptions)
- func (c *Client) NotifyReleaseFailedEvent(ctx context.Context, event NotifyReleaseFailedOptions) error
- func (c *Client) NotifyReleaseManagerError(ctx context.Context, ...) error
- func (c *Client) NotifySlackBuildsChannel(options BuildsOptions) error
- func (c *Client) NotifySlackPolicyFailed(ctx context.Context, email, title, errorMessage string) error
- func (c *Client) NotifySlackPolicySucceeded(ctx context.Context, email, title, message string) error
- func (c *Client) PostSlackBuildStarted(email, title, titleLink, text, color string) (string, string, error)
- func (c *Client) UpdateMessage(path string, f func(Message) Message) error
- func (c *Client) UpdateSlackBuildStatus(channel, title, titleLink, text, color, timestamp string) (string, string, error)
- type Message
- type MockSlackClient
- func (_m *MockSlackClient) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
- func (_m *MockSlackClient) PostMessage(channelID string, options ...slack.MsgOption) (string, string, error)
- func (_m *MockSlackClient) PostMessageContext(ctx context.Context, channelID string, options ...slack.MsgOption) (string, string, error)
- func (_m *MockSlackClient) UpdateMessage(channelID string, timestamp string, options ...slack.MsgOption) (string, string, string, error)
- type MuteOptions
- type NotifyK8sDeployOptions
- type NotifyReleaseFailedOptions
- type ReleaseOptions
- type SlackClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFileNotFound indicates that an artifact was not found. ErrFileNotFound = errors.New("file not found") // ErrNotParsable indicates that an artifact could not be parsed against the // artifact specification. ErrNotParsable = errors.New("message not parsable") // ErrUnknownFields indicates that an artifact contains an unknown field. ErrUnknownFields = errors.New("message contains unknown fields") MsgColorGreen = "#73BF69" MsgColorYellow = "#FADE2A" MsgColorRed = "#F2495C" )
View Source
var ( // ErrUnknownEmail indicates that an email is not from the specified domain // and no email mapping exists ErrUnknownEmail = errors.New("not an accepted email domain") )
Functions ¶
func ParseUserMappings ¶ added in v0.0.15
ParseUserMappings parses the slice users as key-value pairs separated with an equal (=) sign.
If any of the provided mappings are invalid or conflicting mappings are provided an error is returned.
Types ¶
type BuildsOptions ¶ added in v0.0.10
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewMuteableClient ¶ added in v0.4.1
func NewMuteableClient(slackClient SlackClient, emailMappings map[string]string, emailSuffix string, muteOptions MuteOptions) (*Client, error)
func (*Client) NotifyK8SDeployEvent ¶ added in v0.5.0
func (c *Client) NotifyK8SDeployEvent(ctx context.Context, event NotifyK8sDeployOptions) error
func (*Client) NotifyK8SJobErrorEvent ¶ added in v0.12.4
func (*Client) NotifyK8SPodErrorEvent ¶ added in v0.5.0
func (*Client) NotifyRelease ¶ added in v0.23.0
func (c *Client) NotifyRelease(ctx context.Context, releaseOptions ReleaseOptions)
func (*Client) NotifyReleaseFailedEvent ¶ added in v0.26.0
func (c *Client) NotifyReleaseFailedEvent(ctx context.Context, event NotifyReleaseFailedOptions) error
func (*Client) NotifyReleaseManagerError ¶ added in v0.6.0
func (*Client) NotifySlackBuildsChannel ¶ added in v0.0.10
func (c *Client) NotifySlackBuildsChannel(options BuildsOptions) error
func (*Client) NotifySlackPolicyFailed ¶ added in v0.0.15
func (*Client) NotifySlackPolicySucceeded ¶ added in v0.0.40
func (*Client) PostSlackBuildStarted ¶ added in v0.0.6
func (*Client) UpdateMessage ¶ added in v0.0.15
UpdateMessage updates the message in the file located at path by applying f on the contents.
The stored Slack build message is updated accordingly.
type Message ¶ added in v0.0.6
type Message struct { Color string `json:"color,omitempty"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"titleLink,omitempty"` Timestamp string `json:"timestamp,omitempty"` Service string `json:"service,omitempty"` }
type MockSlackClient ¶ added in v0.11.3
MockSlackClient is an autogenerated mock type for the SlackClient type
func (*MockSlackClient) GetUserByEmailContext ¶ added in v0.11.3
func (_m *MockSlackClient) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
GetUserByEmailContext provides a mock function with given fields: ctx, email
func (*MockSlackClient) PostMessage ¶ added in v0.11.3
func (_m *MockSlackClient) PostMessage(channelID string, options ...slack.MsgOption) (string, string, error)
PostMessage provides a mock function with given fields: channelID, options
type MuteOptions ¶ added in v0.4.1
type NotifyK8sDeployOptions ¶ added in v0.25.0
type NotifyReleaseFailedOptions ¶ added in v0.26.0
type ReleaseOptions ¶ added in v0.0.10
type SlackClient ¶ added in v0.11.3
type SlackClient interface { GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error) UpdateMessage(channelID, timestamp string, options ...slack.MsgOption) (string, string, string, error) PostMessage(channelID string, options ...slack.MsgOption) (string, string, error) PostMessageContext(ctx context.Context, channelID string, options ...slack.MsgOption) (string, string, error) }
Click to show internal directories.
Click to hide internal directories.