reporter

package
v0.0.0-...-a2d9e6c Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OKMessage = iota
	WarnMessage
	ErrorMessage
)

Messages types

View Source
const (
	FlushInterval   = 30 * time.Second
	BotName         = "Kafka objects operator"
	MsgColorOK      = "#00CC00"
	MsgColorWarning = "#F5EC1E"
	MsgColorError   = "#EE0000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

func NewMessage

func NewMessage(msg string, msgType MessageType) *Message

NewMessage would initialises Message and would return it

func (*Message) MsgType

func (m *Message) MsgType() MessageType

MsgType would return type of this message

func (*Message) String

func (m *Message) String() string

type MessageType

type MessageType uint8

type Messenger

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

func New

func New(token string, options ...Options) (*Messenger, error)

func (*Messenger) Send

func (m *Messenger) Send(msg string, msgType MessageType)

Send will send message to slack

type Options

type Options func(*Messenger) error

func HTTPClient

func HTTPClient(hc *http.Client) Options

HTTPClient will add http client for Slack Messenger

func SlackChannel

func SlackChannel(sl string) Options

SlackChannel will add slack channel name

func SlackClient

func SlackClient(sl Slack) Options

SlackClient will add slack client for mocking purposes only use it in tests

func TickInterval

func TickInterval(tk time.Duration) Options

SlackClient will add slack client for mocking purposes only use it in tests

type Slack

type Slack interface {
	PostMessage(channelID string, options ...slack.MsgOption) (string, string, error)
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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