Documentation
¶
Index ¶
- Constants
- type API
- type AlertDeliveryError
- type HTTPWrapper
- type HTTPWrapperiface
- type HTTPiface
- type OutputClient
- func (client *OutputClient) Asana(alert *alertmodels.Alert, config *outputmodels.AsanaConfig) *AlertDeliveryError
- func (client *OutputClient) Github(alert *alertmodels.Alert, config *outputmodels.GithubConfig) *AlertDeliveryError
- func (client *OutputClient) Jira(alert *alertmodels.Alert, config *outputmodels.JiraConfig) *AlertDeliveryError
- func (client *OutputClient) MsTeams(alert *alertmodels.Alert, config *outputmodels.MsTeamsConfig) *AlertDeliveryError
- func (client *OutputClient) Opsgenie(alert *alertmodels.Alert, config *outputmodels.OpsgenieConfig) *AlertDeliveryError
- func (client *OutputClient) PagerDuty(alert *alertmodels.Alert, config *outputmodels.PagerDutyConfig) *AlertDeliveryError
- func (client *OutputClient) Slack(alert *alertmodels.Alert, config *outputmodels.SlackConfig) *AlertDeliveryError
- func (client *OutputClient) Sns(alert *alertmodels.Alert, config *outputmodels.SnsConfig) *AlertDeliveryError
- func (client *OutputClient) Sqs(alert *alertmodels.Alert, config *outputmodels.SqsConfig) *AlertDeliveryError
- type PostInput
Constants ¶
const (
AuthorizationHTTPHeader = "Authorization"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Slack(*alertmodels.Alert, *outputmodels.SlackConfig) *AlertDeliveryError PagerDuty(*alertmodels.Alert, *outputmodels.PagerDutyConfig) *AlertDeliveryError Github(*alertmodels.Alert, *outputmodels.GithubConfig) *AlertDeliveryError Jira(*alertmodels.Alert, *outputmodels.JiraConfig) *AlertDeliveryError Opsgenie(*alertmodels.Alert, *outputmodels.OpsgenieConfig) *AlertDeliveryError MsTeams(*alertmodels.Alert, *outputmodels.MsTeamsConfig) *AlertDeliveryError Sqs(*alertmodels.Alert, *outputmodels.SqsConfig) *AlertDeliveryError Sns(*alertmodels.Alert, *outputmodels.SnsConfig) *AlertDeliveryError Asana(*alertmodels.Alert, *outputmodels.AsanaConfig) *AlertDeliveryError }
API is the interface for output delivery that can be used for mocks in tests.
type AlertDeliveryError ¶
type AlertDeliveryError struct { // Message is the description of the problem: what went wrong. Message string // Permanent indicates whether the alert output should be retried. // For example, outputs which don't exist or errors creating the request are permanent failures. // But any error talking to the output itself can be retried by the Lambda function later. Permanent bool }
AlertDeliveryError indicates whether a failed alert should be retried.
func (*AlertDeliveryError) Error ¶
func (e *AlertDeliveryError) Error() string
type HTTPWrapper ¶
type HTTPWrapper struct {
// contains filtered or unexported fields
}
HTTPWrapper encapsulates the Golang's http client
type HTTPWrapperiface ¶
type HTTPWrapperiface interface {
// contains filtered or unexported methods
}
HTTPWrapperiface is the interface for our wrapper around Golang's http client
type OutputClient ¶
type OutputClient struct {
// contains filtered or unexported fields
}
OutputClient encapsulates the clients that allow sending alerts to multiple outputs
func New ¶
func New(sess *session.Session) *OutputClient
New creates a new client for alert delivery.
func (*OutputClient) Asana ¶ added in v0.2.0
func (client *OutputClient) Asana(alert *alertmodels.Alert, config *outputmodels.AsanaConfig) *AlertDeliveryError
Asana creates a task in Asana projects
func (*OutputClient) Github ¶
func (client *OutputClient) Github( alert *alertmodels.Alert, config *outputmodels.GithubConfig) *AlertDeliveryError
Github alert send an issue.
func (*OutputClient) Jira ¶
func (client *OutputClient) Jira( alert *alertmodels.Alert, config *outputmodels.JiraConfig) *AlertDeliveryError
Jira alert send an issue.
func (*OutputClient) MsTeams ¶
func (client *OutputClient) MsTeams( alert *alertmodels.Alert, config *outputmodels.MsTeamsConfig) *AlertDeliveryError
MsTeams alert send an alert.
func (*OutputClient) Opsgenie ¶
func (client *OutputClient) Opsgenie( alert *alertmodels.Alert, config *outputmodels.OpsgenieConfig) *AlertDeliveryError
Opsgenie alert send an alert.
func (*OutputClient) PagerDuty ¶
func (client *OutputClient) PagerDuty(alert *alertmodels.Alert, config *outputmodels.PagerDutyConfig) *AlertDeliveryError
PagerDuty sends an alert to a pager duty integration endpoint.
func (*OutputClient) Slack ¶
func (client *OutputClient) Slack(alert *alertmodels.Alert, config *outputmodels.SlackConfig) *AlertDeliveryError
Slack sends an alert to a slack channel.
func (*OutputClient) Sns ¶
func (client *OutputClient) Sns(alert *alertmodels.Alert, config *outputmodels.SnsConfig) *AlertDeliveryError
Sns sends an alert to an SNS Topic. nolint: dupl
func (*OutputClient) Sqs ¶
func (client *OutputClient) Sqs(alert *alertmodels.Alert, config *outputmodels.SqsConfig) *AlertDeliveryError
Sqs sends an alert to an SQS Queue. nolint: dupl