notify

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

README

notify Plugin

This plugin sends a message over any of the notification channels defined in µTask's configuration.

Configuration

Fields Description
message the main payload of the notification
fields a collection of extra fields to annotate the message
backends a collection of the backends over which the message will be dispatched (values accepted: named backends as configured in utask-cfg)

Example

An action of type notify requires the following kind of configuration:

action:
  type: notify
  configuration:
    # the payload of your notification
    message: Hello World! 
    # a list of extra fields as map of string, to contextualize your message
    fields: 
      randomfield: urgent 
      language: english
    # a list of destination backends as defined in 'utask-cfg' (will be sent to ALL backends if left empty or null)
    backends: [tat-internal, slack-customers] 

Requirements

Configuration for at least one notification backend should be provided in the config item named utask-cfg (see config/README.md).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugin = taskplugin.New("notify", "0.1", exec,
		taskplugin.WithConfig(validConfig, Config{}))
)

the notify plugin broadcasts a message over all registered notification senders

Functions

This section is empty.

Types

type Config

type Config struct {
	Msg      string            `json:"message"`
	Flds     map[string]string `json:"fields"`
	Backends []string          `json:"backends"`
}

Config is the configuration needed to send a notification consisting of a message and extra fields implements notify.Payload

func (*Config) Message

func (nc *Config) Message() *notify.Message

Message returns the config's message

Jump to

Keyboard shortcuts

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