notifiers

package
v0.8.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderTypeSlack = "slack"
)

Variables

This section is empty.

Functions

func NewSlackConfig added in v0.7.6

func NewSlackConfig(config *Config) (*slack.Config, error)

Types

type Client

type Client interface {
	Notify(context.Context, []domain.Notification) []error
}

func NewClient

func NewClient(config *Config, logger log.Logger) (Client, error)

type Config

type Config struct {
	Provider string `mapstructure:"provider" validate:"omitempty,oneof=slack"`

	// slack
	AccessToken string      `mapstructure:"access_token" validate:"required_without=SlackConfig"`
	SlackConfig SlackConfig `mapstructure:"slack_config" validate:"required_without=AccessToken,dive"`

	// custom messages
	Messages domain.NotificationMessages
}

type SlackConfig added in v0.7.6

type SlackConfig map[string]interface{}

SlackConfig is a map of workspace name to config

func (SlackConfig) Decode added in v0.7.6

func (c SlackConfig) Decode(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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