Documentation
¶
Index ¶
- type Exporter
- type LogExporter
- type MailgunExporter
- type SNSExporter
- type SlackService
- func (s *SlackService) BuildMessageBlock(msg *formatter.Message) []slack.Block
- func (s *SlackService) GenerateTextBlock(text string) slack.Block
- func (s SlackService) Name() string
- func (s *SlackService) PostMessage(blocks ...slack.Block) (string, string, error)
- func (s SlackService) Send(msg *formatter.Message) error
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.
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 .
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 .
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) PostMessage ¶
PostMessage sends provided slack MessageBlocks to the given slack channel
Click to show internal directories.
Click to hide internal directories.