slack

package
v1.9.26 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSet

func NewSet[S Storable]() *set[S]

func NewSetFromArray

func NewSetFromArray[S Storable](s []S) *set[S]

Types

type Config

type Config struct {
	NotificationsConfigSet []NotificationsConfigSet
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(config []NotificationsConfig) *Config

func (*Config) HasChannelsDefined

func (c *Config) HasChannelsDefined() bool

func (*Config) NeedsSending

func (c *Config) NeedsSending(event *testkube.Event) ([]string, bool)

type MessageArgs

type MessageArgs struct {
	ExecutionName string
	EventType     string
	Namespace     string
	Labels        string
	TestName      string
	TestType      string
	Status        string
	FailedSteps   int
	TotalSteps    int
	StartTime     string
	EndTime       string
	Duration      string
}

type NotificationsConfig

type NotificationsConfig struct {
	ChannelID      string               `json:"channelID,omitempty"`
	Selector       map[string]string    `json:"selector,omitempty"`
	TestNames      []string             `json:"testName,omitempty"`
	TestSuiteNames []string             `json:"testSuiteName,omitempty"`
	Events         []testkube.EventType `json:"events,omitempty"`
}

type NotificationsConfigSet

type NotificationsConfigSet struct {
	ChannelID      string
	Selector       map[string]string
	TestNames      *set[string]
	TestSuiteNames *set[string]
	Events         *set[testkube.EventType]
}

type Notifier

type Notifier struct {
	Ready bool
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(template string, config []NotificationsConfig) *Notifier

func (*Notifier) SendEvent

func (s *Notifier) SendEvent(event *testkube.Event) error

SendEvent composes an event message and sends it to slack

func (*Notifier) SendMessage

func (s *Notifier) SendMessage(channelID string, message string) error

SendMessage posts a message to the slack configured channel

type Storable

type Storable interface {
	string | testkube.EventType
}

Jump to

Keyboard shortcuts

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