notify

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 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(m *Message, params utask.NotifyActionsParameters)

Send dispatches a Message struct over all registered senders

func WrappedSendError added in v1.1.0

func WrappedSendError(etype string, err string)

WrappedSendError print a formatted string from Send Notify in case of issue

Types

type Message added in v1.1.0

type Message struct {
	MainMessage string
	Fields      map[string]string
}

Message represents a generic message to be sent

func WrapTaskStateUpdate added in v1.1.0

func WrapTaskStateUpdate(tsu *TaskStateUpdate) *Message

WrapTaskStateUpdate returns a Message struct formatted for a task state change

type NotificationSender

type NotificationSender interface {
	Send(m *Message, name string)
}

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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