Documentation ¶
Index ¶
- Constants
- func ListActions() utask.NotifyActions
- func ListSendersNames() []string
- func RegisterActions(na utask.NotifyActions)
- func RegisterSender(name string, s NotificationSender, ...)
- func Send(m *Message, params utask.NotifyActionsParameters)
- func WrappedSendError(err error, m *Message, backend, name string)
- func WrappedSendErrorWithBody(err error, m *Message, backend, name, body string)
- type Message
- type NotificationSender
- type TaskStateUpdate
- type TaskStepUpdate
- type TaskValidation
Constants ¶
const ( TaskStateUpdateKey = "task_state_update" TaskStepUpdateKey = "task_step_update" TaskValidationKey = "task_validation" )
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(name string, s NotificationSender, defaultNotificationStrategy map[string]string, templateNotificationStrategies map[string][]utask.TemplateNotificationStrategy)
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
WrappedSendError captures an error from Send Notify
func WrappedSendErrorWithBody ¶ added in v1.21.0
WrappedSendErrorWithBody captures an error with a response body from Send Notify.
Types ¶
type Message ¶ added in v1.1.0
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
func WrapTaskStepUpdate ¶ added in v1.13.0
func WrapTaskStepUpdate(tsu *TaskStepUpdate) *Message
WrapTaskStepUpdate returns a Message struct formatted for a task step update
func WrapTaskValidation ¶ added in v1.13.0
func WrapTaskValidation(tv *TaskValidation) *Message
WrapTaskValidation returns a Message struct formatted for a task requiring validation
type NotificationSender ¶
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 ResolutionPublicID string State string TemplateName string RequesterUsername string ResolverUsername *string PotentialResolvers []string StepsDone int StepsTotal int Tags map[string]string }
TaskStateUpdate holds a digest of data representing a task state change
type TaskStepUpdate ¶ added in v1.13.0
type TaskStepUpdate struct { Title string PublicID string ResolutionPublicID string State string TemplateName string RequesterUsername string ResolverUsername string StepsDone int StepsTotal int StepName string StepState string Tags map[string]string }
TaskStepUpdate holds a digest of data representing a task step update