exporter

package
v0.0.0-...-38dc3a1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	// Send implements payload transmission for each exporter
	Send(msg *formatter.Message) error
	// Name retruns exporter name
	Name() string
}

Exporter defines a common interface for different exporters

type LogExporter

type LogExporter struct {
	// contains filtered or unexported fields
}

LogExporter is a dummy exporter which prints formatted message to stdout. For debug and educational purposes.

func NewLogExporter

func NewLogExporter(name string) *LogExporter

NewLogExporter .

func (LogExporter) Name

func (l LogExporter) Name() string

Name .

func (LogExporter) Send

func (l LogExporter) Send(msg *formatter.Message) error

Send prints message to stdout

type MailgunExporter

type MailgunExporter struct {
	// contains filtered or unexported fields
}

MailgunExporter lets you send reports via email

func NewMailgunExporter

func NewMailgunExporter(name string, recipients string, from string, apiKey string) *MailgunExporter

NewMailgunExporter .

func (MailgunExporter) Name

func (m MailgunExporter) Name() string

Name .

func (MailgunExporter) Send

func (m MailgunExporter) Send(msg *formatter.Message) error

Send sends report via Mailgun

type SNSExporter

type SNSExporter struct {
	// contains filtered or unexported fields
}

SNSExporter publishes message to SNS topic as json

func NewSNSExporter

func NewSNSExporter(name string, client *api.SNSService, topicARN string) *SNSExporter

NewSNSExporter .

func (SNSExporter) Name

func (s SNSExporter) Name() string

Name .

func (SNSExporter) Send

func (s SNSExporter) Send(msg *formatter.Message) error

Send publishes report to an arbitrary SNS topic in json format

type SlackService

type SlackService struct {
	// contains filtered or unexported fields
}

SlackService data structure for storing slack client related data

func NewSlackExporter

func NewSlackExporter(name string, token string, channel string) *SlackService

NewSlackExporter populates a new SlackService instance

func (*SlackService) BuildMessageBlock

func (s *SlackService) BuildMessageBlock(msg *formatter.Message) []slack.Block

BuildMessageBlock constructs severity related message body

func (*SlackService) GenerateTextBlock

func (s *SlackService) GenerateTextBlock(text string) slack.Block

GenerateTextBlock returns a slack SectionBlock for text input

func (SlackService) Name

func (s SlackService) Name() string

Name .

func (*SlackService) PostMessage

func (s *SlackService) PostMessage(blocks ...slack.Block) (string, string, error)

PostMessage sends provided slack MessageBlocks to the given slack channel

func (SlackService) Send

func (s SlackService) Send(msg *formatter.Message) error

Send sends report to an arbitrary Slack channel

Jump to

Keyboard shortcuts

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