Documentation
¶
Index ¶
- type Client
- func (c *Client) CWAlarmHeaderBlock(evt *cw.EventDetails, prefix string) *slackapi.SectionBlock
- func (c *Client) CWAlarmLink(evt *cw.EventDetails) *slackapi.SectionBlock
- func (c *Client) CWAlarmSummary(evt *cw.EventDetails) *slackapi.SectionBlock
- func (c *Client) ImageLink(url string) *slackapi.ImageBlock
- func (c *Client) SendEventResolved(slackChannel string, evt *cw.EventDetails, imageLink string) (string, string, error)
- func (c *Client) SendEventTriggered(slackChannel string, evt *cw.EventDetails, imageLink string) (string, string, error)
- func (c *Client) SendMessage(channel string, opts ...slackapi.MsgOption) (string, string, error)
- func (c *Client) SendSimpleTextMessage(channel string, message string) (string, string, error)
- type ClientOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps slack with simpler more specific calls suited for this lambda
func New ¶
func New(slackAPIToken string, opts ...ClientOptions) (*Client, error)
New returns a newly initialized slack client
func (*Client) CWAlarmHeaderBlock ¶
func (c *Client) CWAlarmHeaderBlock(evt *cw.EventDetails, prefix string) *slackapi.SectionBlock
CWAlarmHeaderBlock produces a slack block for the alarm details - regardless of state
func (*Client) CWAlarmLink ¶
func (c *Client) CWAlarmLink(evt *cw.EventDetails) *slackapi.SectionBlock
CWAlarmLink adds a link to the cloudwatch console to the slack message
func (*Client) CWAlarmSummary ¶
func (c *Client) CWAlarmSummary(evt *cw.EventDetails) *slackapi.SectionBlock
CWAlarmSummary returns a slack block with the cloudwatch alarm summary (ie: metrics, reason, etc)
func (*Client) ImageLink ¶
func (c *Client) ImageLink(url string) *slackapi.ImageBlock
ImageLink adds an image ref to the given url
func (*Client) SendEventResolved ¶
func (c *Client) SendEventResolved(slackChannel string, evt *cw.EventDetails, imageLink string) (string, string, error)
SendEventResolved will send a resolved message given the event details
func (*Client) SendEventTriggered ¶
func (c *Client) SendEventTriggered(slackChannel string, evt *cw.EventDetails, imageLink string) (string, string, error)
SendEventTriggered will send a triggered message given the event details
func (*Client) SendMessage ¶
SendMessage sends a message to a slack channel
type ClientOptions ¶
type ClientOptions func(*Client)
ClientOptions provides the function opts pattern for overriding
func OptionDebug ¶
func OptionDebug(d bool) ClientOptions
OptionDebug allows enabling/disabling debug
func WithAlternativeURL ¶
func WithAlternativeURL(url string) ClientOptions
WithAlternativeURL supplies an alternative URL to make slack api calls