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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListActions

func ListActions() utask.NotifyActions

ListActions returns a list of available actions to notify

func ListSendersNames

func ListSendersNames() []string

ListSendersNames returns a list of available senders

func RegisterActions

func RegisterActions(na utask.NotifyActions)

RegisterActions set available actions

func RegisterSender

func RegisterSender(s NotificationSender, name string)

RegisterSender adds a NotificationSender to the pool of available senders

func Send

func Send(p Payload, params utask.NotifyActionsParameters)

Send dispatches a Payload over all registered senders

Types

type NotificationSender

type NotificationSender interface {
	Send(p Payload)
}

NotificationSender is an object capable of sending a payload over a notification channel, as determined by its implementation

type Payload

type Payload interface {
	Message() string
	Fields() []string
}

Payload is the holder of data to be sent as a notification

type TaskStateUpdate

type TaskStateUpdate struct {
	Title              string
	PublicID           string
	State              string
	TemplateName       string
	RequesterUsername  string
	ResolverUsername   *string
	PotentialResolvers []string
	StepsDone          int
	StepsTotal         int
}

TaskStateUpdate holds a digest of data representing a task state change

func (TaskStateUpdate) Fields

func (tsu TaskStateUpdate) Fields() []string

Fields returns a list of formatted fields to qualify a message

func (TaskStateUpdate) Message

func (tsu TaskStateUpdate) Message() string

Message renders a string representation of a TaskStateUpdate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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