notifier

package
v0.0.0-...-b1767e8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageRenderer

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

MessageRenderer renders Slack message

func NewMessageRenderer

func NewMessageRenderer() (*MessageRenderer, error)

NewMessageRenderer returns new instance of MessageRenderer

func (*MessageRenderer) RenderSlackMessage

func (s *MessageRenderer) RenderSlackMessage(in RenderSlackMessageInput) (string, string, string, error)

RenderSlackMessage returns header and body summary of given tests

type RenderSlackMessageInput

type RenderSlackMessageInput struct {
	Details     string
	Header      string
	ClusterName string
	LogID       string
}

RenderSlackMessageInput holds input parameters required to render test summary

type SlackClient

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

SlackClient sends message to slack channel

func NewSlackClient

func NewSlackClient(cfg SlackClientConfig) *SlackClient

NewSlackClient returns new instance of SlackClient

func (*SlackClient) Send

func (c *SlackClient) Send(header, body, footer, color string) error

Send sends message with given content to slack channel

type SlackClientConfig

type SlackClientConfig struct {
	ChannelID  string
	WebhookURL string
	Token      string
}

SlackClientConfig holds configuration for slack client

type SlackNotifier

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

SlackNotifier sends notification messages to Slack channel.

func New

func New(clusterName string, slack slackClient, testRenderer msgRenderer) *SlackNotifier

New returns new instance of SlackNotifier

func (*SlackNotifier) Notify

func (s *SlackNotifier) Notify(id, header, details string) error

Notify sends notification message to Slack channel

Jump to

Keyboard shortcuts

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