notify

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticSearch added in v0.7.0

type ElasticSearch struct {
	Username string
	Password string
	Server   string
	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 Mattermost added in v0.7.0

type Mattermost struct {
	Client      *model.Client4
	Channel     string
	ClusterName string
}

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

type Notifier interface {
	SendEvent(events.Event) error
	SendMessage(string) error
}

Notifier to send event notification on the communication channels

func NewElasticSearch added in v0.7.0

func NewElasticSearch(c *config.Config) Notifier

NewElasticSearch returns new Slack object

func NewMattermost added in v0.7.0

func NewMattermost(c *config.Config) (Notifier, error)

NewMattermost returns new Mattermost object

func NewSlack

func NewSlack(c *config.Config) Notifier

NewSlack returns new Slack object

type Slack

type Slack struct {
	Token       string
	Channel     string
	ClusterName string
}

Slack contains Token for authentication with slack and Channel name to send notification to

func (*Slack) SendEvent

func (s *Slack) SendEvent(event events.Event) error

SendEvent sends event notification to slack

func (*Slack) SendMessage

func (s *Slack) SendMessage(msg string) error

SendMessage sends message to slack channel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL