Documentation ¶
Index ¶
- func FormatShortMessage(event events.Event) (msg string)
- type Discord
- type ElasticSearch
- type EventMeta
- type EventStatus
- type Mattermost
- type Notifier
- func ListNotifiers(conf config.CommunicationsConfig) []Notifier
- func NewDiscord(c config.Discord) Notifier
- func NewElasticSearch(c config.ElasticSearch) (Notifier, error)
- func NewMattermost(c config.Mattermost) (Notifier, error)
- func NewSlack(c config.Slack) Notifier
- func NewWebhook(c config.CommunicationsConfig) Notifier
- type Slack
- type Webhook
- type WebhookPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatShortMessage ¶ added in v0.11.0
FormatShortMessage prepares message in short event format
Types ¶
type Discord ¶ added in v0.12.0
Discord contains URL and ClusterName
func (*Discord) SendMessage ¶ added in v0.12.0
SendMessage sends message to Discord Channel
type ElasticSearch ¶ added in v0.7.0
type ElasticSearch struct { ELSClient *elastic.Client Server string SkipTLSVerify bool Index string Shards int Replicas int Type string }
ElasticSearch contains auth cred and index setting
func (*ElasticSearch) SendEvent ¶ added in v0.7.0
func (e *ElasticSearch) SendEvent(event events.Event) (err error)
SendEvent sends event notification to slack
func (*ElasticSearch) SendMessage ¶ added in v0.7.0
func (e *ElasticSearch) SendMessage(msg string) error
SendMessage sends message to slack channel
type EventMeta ¶ added in v0.9.0
type EventMeta struct { Kind string `json:"kind"` Name string `json:"name"` Namespace string `json:"namespace"` Cluster string `json:"cluster,omitempty"` }
EventMeta contains the meta data about the event occurred
type EventStatus ¶ added in v0.9.0
type EventStatus struct { Type config.EventType `json:"type"` Level config.Level `json:"level"` Reason string `json:"reason,omitempty"` Error string `json:"error,omitempty"` Messages []string `json:"messages,omitempty"` }
EventStatus contains the status about the event occurred
type Mattermost ¶ added in v0.7.0
Mattermost contains server URL and token
func (*Mattermost) SendEvent ¶ added in v0.7.0
func (m *Mattermost) SendEvent(event events.Event) error
SendEvent sends event notification to Mattermost
func (*Mattermost) SendMessage ¶ added in v0.7.0
func (m *Mattermost) SendMessage(msg string) error
SendMessage sends message to Mattermost channel
type Notifier ¶
Notifier to send event notification on the communication channels
func ListNotifiers ¶ added in v0.11.0
func ListNotifiers(conf config.CommunicationsConfig) []Notifier
ListNotifiers returns list of configured notifiers
func NewDiscord ¶ added in v0.12.0
NewDiscord returns new Discord object
func NewElasticSearch ¶ added in v0.7.0
func NewElasticSearch(c config.ElasticSearch) (Notifier, error)
NewElasticSearch returns new ElasticSearch object
func NewMattermost ¶ added in v0.7.0
func NewMattermost(c config.Mattermost) (Notifier, error)
NewMattermost returns new Mattermost object
func NewWebhook ¶ added in v0.9.0
func NewWebhook(c config.CommunicationsConfig) Notifier
NewWebhook returns new Webhook object
type Slack ¶
Slack contains Token for authentication with slack and Channel name to send notification to
func (*Slack) SendMessage ¶
SendMessage sends message to slack channel
type Webhook ¶ added in v0.9.0
type Webhook struct {
URL string
}
Webhook contains URL
func (*Webhook) PostWebhook ¶ added in v0.9.0
func (w *Webhook) PostWebhook(jsonPayload *WebhookPayload) error
PostWebhook posts webhook to listener
func (*Webhook) SendMessage ¶ added in v0.9.0
SendMessage sends message to Webhook url
type WebhookPayload ¶ added in v0.9.0
type WebhookPayload struct { EventMeta EventMeta `json:"meta"` EventStatus EventStatus `json:"status"` EventSummary string `json:"summary"` TimeStamp time.Time `json:"timestamp"` Recommendations []string `json:"recommendations,omitempty"` Warnings []string `json:"warnings,omitempty"` }
WebhookPayload contains json payload to be sent to webhook url