slack

package
v0.12.7-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMessage

func ParseMessage(message domain.NotificationMessage, templates domain.NotificationMessages, defaultTemplateFiles embed.FS) (string, error)

Types

type Config

type Config struct {
	Workspaces []SlackWorkspace `mapstructure:"workspaces"`
	Messages   domain.NotificationMessages
}

type Notifier

type Notifier struct {
	Messages domain.NotificationMessages
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(config *Config, httpClient utils.HTTPClient, logger log.Logger) *Notifier

func (*Notifier) GetSlackWorkspaceForUser added in v0.7.6

func (n *Notifier) GetSlackWorkspaceForUser(email string, variables map[string]any) (*SlackWorkspace, error)

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, items []domain.Notification) []error

type SlackWorkspace added in v0.7.6

type SlackWorkspace struct {
	WorkspaceName string `mapstructure:"workspace" validate:"required"`
	AccessToken   string `mapstructure:"access_token" validate:"required"`
	Criteria      string `mapstructure:"criteria" validate:"required"`
}

type WorkSpaceConfig added in v0.7.6

type WorkSpaceConfig struct {
	Workspaces []SlackWorkspace `mapstructure:"workspaces"`
}

Jump to

Keyboard shortcuts

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