sender

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	Status       chan (string)
	Availability chan (string)
	T            *testing.T
}

Mock sender is used for testing procjon server.

func (*Mock) SendAvailability

func (m *Mock) SendAvailability(service string, available bool) error

SendAvailability sends availability to Availability channel formatted as "service available", eg. "redis false". It also logs service and availability to testing.T.

func (*Mock) SendStatus

func (m *Mock) SendStatus(service, status string) error

SendStatus sends status to Status channel formatted as "service status", eg. "redis ok". It also logs service and status to testing.T.

type Slack

type Slack struct {
	Webhook string
}

Slack should be initialized with valid webhook for posting messages. See https://api.slack.com/messaging/webhooks for instructions on how to setup incoming webhooks.

func (*Slack) SendAvailability

func (s *Slack) SendAvailability(service string, available bool) error

SendAvailability nicely formatted to Slack webhook.

func (*Slack) SendStatus

func (s *Slack) SendStatus(service, status string) error

SendStatus nicely formatted to Slack webhook.

Jump to

Keyboard shortcuts

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