Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendMsTeams ¶
func SendMsTeams(ctx context.Context, webhookUrl string, message MsTeamsMessagePayload) error
Types ¶
type AlertsConfig ¶
type AlertsConfig struct { Default CategoryConfig `yaml:"default"` Categories map[string]CategoryConfig `yaml:"categories"` }
func ReadConfig ¶
func ReadConfig(filePath string) (*AlertsConfig, error)
type CategoryConfig ¶
type CategoryConfig struct { Slack []SlackAlertConfig `yaml:"slack"` MsTeams []MsTeamsAlertConfig `yaml:"ms_teams"` }
type ConfigAlerter ¶
type ConfigAlerter struct {
// contains filtered or unexported fields
}
func NewConfigAlerter ¶
func NewConfigAlerter(log zerolog.Logger, config *AlertsConfig, appName string) *ConfigAlerter
func NewConfigAlerterFromEnv ¶
func NewConfigAlerterFromEnv(log zerolog.Logger, appName string) (*ConfigAlerter, error)
type MsTeamsAlertConfig ¶
type MsTeamsAlerter ¶
type MsTeamsAlerter struct { Log zerolog.Logger Configs []MsTeamsAlertConfig DefaultPrefix string }
type MsTeamsMessagePayload ¶
type MsTeamsMessagePayload struct {
Text string `json:"text"`
}
type SlackAlertConfig ¶
type SlackAlertConfig struct { // Required if WebhookAwsSecret is not set. Webhook string `yaml:"webhook"` // Required if Webhook is not set, otherwise ignored. WebhookAwsSecret *AwsSecret `yaml:"webhook_aws_secret"` // Optional. Channel string `yaml:"channel"` // Optional. Username string `yaml:"username"` // Optional. IconEmoji string `yaml:"icon_emoji"` }
type SlackAlerter ¶
type SlackAlerter struct { Log zerolog.Logger Configs []SlackAlertConfig DefaultUsername string }
Click to show internal directories.
Click to hide internal directories.