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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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