Documentation
¶
Index ¶
- type Channels
- type Client
- func (c *Client) SendAlarm(ctx context.Context, summary string, err error, details map[string]interface{}) error
- func (c *Client) SendInfo(ctx context.Context, summary string, details map[string]interface{}) error
- func (c *Client) SendWarning(ctx context.Context, summary string, details map[string]interface{}) error
- type Clienter
- type Colour
- type Emoji
- type NoopClient
- func (n *NoopClient) SendAlarm(ctx context.Context, summary string, err error, details map[string]interface{}) error
- func (n *NoopClient) SendInfo(ctx context.Context, summary string, details map[string]interface{}) error
- func (n *NoopClient) SendWarning(ctx context.Context, summary string, details map[string]interface{}) error
- type SlackConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channels ¶ added in v1.12.0
type Channels struct {
InfoChannel string `envconfig:"SLACK_INFO_CHANNEL"`
WarningChannel string `envconfig:"SLACK_WARNING_CHANNEL"`
AlarmChannel string `envconfig:"SLACK_ALARM_CHANNEL"`
}
Channels holds the Slack channel names for different notification levels
type Client ¶ added in v1.12.0
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the go-slack client
func (*Client) SendAlarm ¶ added in v1.12.0
func (c *Client) SendAlarm(ctx context.Context, summary string, err error, details map[string]interface{}) error
SendAlarm sends an error notification to the configured Slack alarm channel.
type Clienter ¶ added in v1.12.0
type Clienter interface {
SendAlarm(ctx context.Context, summary string, err error, details map[string]interface{}) error
SendWarning(ctx context.Context, summary string, details map[string]interface{}) error
SendInfo(ctx context.Context, summary string, details map[string]interface{}) error
}
Clienter represents an interface for a generic Client
type Emoji ¶ added in v1.12.0
type Emoji string
type NoopClient ¶ added in v1.12.0
type NoopClient struct{}
NoopClient is a Client that does nothing, used when Slack notifications are disabled
func (*NoopClient) SendWarning ¶ added in v1.12.0
type SlackConfig ¶
type SlackConfig struct {
Channels Channels
}
SlackConfig holds configuration for sending Slack notifications
Click to show internal directories.
Click to hide internal directories.