Documentation ¶
Index ¶
- type Config
- type Engine
- func (p *Engine) AuthLinkURL(ctx context.Context, providerID, subjectID string, meta authlink.Metadata) (url string, err error)
- func (n *Engine) IsKnownDest(ctx context.Context, destType notification.DestType, destValue string) (bool, error)
- func (c Engine) NextCycleID() uuid.UUID
- func (p *Engine) Pause(ctx context.Context) error
- func (p *Engine) Receive(ctx context.Context, callbackID string, result notification.Result) error
- func (p *Engine) ReceiveSubject(ctx context.Context, providerID, subjectID, callbackID string, ...) error
- func (p *Engine) Resume(ctx context.Context) error
- func (p *Engine) Run(ctx context.Context) error
- func (p *Engine) SetSendResult(ctx context.Context, res *notification.SendResult) error
- func (p *Engine) Shutdown(ctx context.Context) error
- func (p *Engine) Start(ctx context.Context, d notification.Dest) error
- func (p *Engine) Stop(ctx context.Context, d notification.Dest) error
- func (p *Engine) Trigger()
- func (c Engine) WaitCycleID(ctx context.Context, cycleID uuid.UUID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AlertLogStore *alertlog.Store AlertStore *alert.Store ContactMethodStore *contactmethod.Store NotificationManager *notification.Manager UserStore *user.Store NotificationStore *notification.Store NCStore *notificationchannel.Store OnCallStore *oncall.Store ScheduleStore *schedule.Store AuthLinkStore *authlink.Store SlackStore *slack.ChannelSender ConfigSource config.Source Keys keyring.Keys MaxMessages int DisableCycle bool LogCycles bool CycleTime time.Duration }
Config contains parameters for controlling how the Engine operates.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles automatic escalation of unacknowledged(triggered) alerts, as well as passing to-be-sent notifications to the notification.Sender.
Care is taken to ensure only one attempt is made per contact-method at a time, regardless of how many instances of the application may be running.
func NewEngine ¶
NewEngine will create a new Engine using the passed *sql.DB as a backend. Outgoing notifications will be passed to Sender.
Context is only used for preparing and initializing.
func (*Engine) AuthLinkURL ¶ added in v0.30.0
func (*Engine) IsKnownDest ¶ added in v0.28.0
func (Engine) NextCycleID ¶ added in v0.30.0
NextCycleID returns the UUID of the next engine cycle.
func (*Engine) ReceiveSubject ¶ added in v0.29.0
func (p *Engine) ReceiveSubject(ctx context.Context, providerID, subjectID, callbackID string, result notification.Result) error
ReceiveSubject will process a notification result.
func (*Engine) SetSendResult ¶ added in v0.28.0
func (p *Engine) SetSendResult(ctx context.Context, res *notification.SendResult) error
SetSendResult will update the status of a message.
func (*Engine) Shutdown ¶
Shutdown will gracefully shutdown the processor, finishing any ongoing tasks.
func (*Engine) Start ¶ added in v0.25.0
Start will enable all associated contact methods of `value` with type `t`. This should be invoked if a user, for example, responds with `START` via sms.
func (*Engine) Stop ¶
Stop will disable all associated contact methods of `value` with type `t`. This should be invoked if a user, for example, responds with `STOP` via SMS.