slack

package
v0.0.0-...-4be01c1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SettingsKey = "messenger_slack"

Variables

This section is empty.

Functions

func SetSettings

func SetSettings(ctx context.Context, writer *metadata.AsyncWriter, settings Settings) error

Types

type MessagePoster

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

type Notifier

type Notifier struct {
	MessagePosterBuilder func(client *slack.Client) MessagePoster
	// contains filtered or unexported fields
}

func New

func New(policy core.Policy, reader metadata.Reader) *Notifier

func NewWithCustomSettingsFetcher

func NewWithCustomSettingsFetcher(policy core.Policy, settingsFetcher func() (*Settings, error)) *Notifier

func (*Notifier) Notify

func (m *Notifier) Notify(n core.Notification, translator translator.Translator) error

implement Notifier

func (*Notifier) SendTestNotification

func (m *Notifier) SendTestNotification() error

func (*Notifier) ValidateSettings

func (m *Notifier) ValidateSettings(s core.Settings) error

type Settings

type Settings struct {
	BearerToken stringutil.Sensitive `json:"bearer_token,omitempty"`
	Channel     string               `json:"channel"`
	Enabled     bool                 `json:"enabled"`
}

func GetSettings

func GetSettings(ctx context.Context, reader metadata.Reader) (*Settings, error)

type SettingsFetcher

type SettingsFetcher func() (*Settings, error)

Jump to

Keyboard shortcuts

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