notify

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

README

notify Plugin

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

Configuration

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

action:
  type: echo
  configuration:
    # the payload of your notification
    message: Hello World! 
    # a list of extra fields, to contextualize your message
    fields: [tag:urgent, tag: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     []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) Fields

func (nc *Config) Fields() []string

Fields returns the config's fields

func (*Config) Message

func (nc *Config) Message() string

Message returns the config's message

Jump to

Keyboard shortcuts

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