Documentation
¶
Index ¶
- Constants
- Variables
- func Register(registry *supportjobs.Registry, worker *DeliverMailWorker)
- func RegisterChannels(registry *supportjobs.Registry, worker *DeliverChannelWorker)
- type ChannelDeliveryStore
- type ChannelProviderInvoker
- type ChannelProviderRequest
- type ChannelProviderResult
- type DeliverChannelArgs
- type DeliverChannelWorker
- type DeliverMailArgs
- type DeliverMailWorker
- type DeliveryStore
- type ProviderResolver
- type ProviderSender
Constants ¶
View Source
const ( WebPushProviderSlot = "notification.channel.web_push" WebPushProviderContract = "sforum.web-push.channel@1" WebPushProviderInput = "sforum.web-push.channel.request@1" )
Variables ¶
Functions ¶
func Register ¶
func Register(registry *supportjobs.Registry, worker *DeliverMailWorker)
func RegisterChannels ¶
func RegisterChannels(registry *supportjobs.Registry, worker *DeliverChannelWorker)
Types ¶
type ChannelDeliveryStore ¶
type ChannelDeliveryStore interface {
GetChannelDelivery(context.Context, int64) (notifications.ChannelDelivery, error)
UpdateChannelDelivery(context.Context, notifications.ChannelDeliveryUpdate) error
ListWebPushSubscriptions(context.Context, int64, bool) ([]notifications.WebPushSubscription, error)
GetWebPushDeliveryAttempt(context.Context, int64, int64) (notifications.WebPushDeliveryAttempt, error)
UpdateWebPushDeliveryAttempt(context.Context, notifications.WebPushDeliveryAttempt) error
MarkWebPushSubscriptionFailed(context.Context, int64, string) error
}
type ChannelProviderInvoker ¶
type ChannelProviderInvoker interface {
InvokeNotificationChannel(context.Context, ChannelProviderRequest) (ChannelProviderResult, error)
}
type ChannelProviderRequest ¶
type ChannelProviderResult ¶
type DeliverChannelArgs ¶
type DeliverChannelArgs struct {
DeliveryID int64 `json:"delivery_id" river:"unique"`
}
func (DeliverChannelArgs) EnqueueOptions ¶
func (DeliverChannelArgs) EnqueueOptions() supportjobs.EnqueueOptions
func (DeliverChannelArgs) Kind ¶
func (DeliverChannelArgs) Kind() string
type DeliverChannelWorker ¶
type DeliverChannelWorker struct {
river.WorkerDefaults[DeliverChannelArgs]
Store ChannelDeliveryStore
Invoker ChannelProviderInvoker
}
func (*DeliverChannelWorker) Work ¶
func (w *DeliverChannelWorker) Work(ctx context.Context, job *river.Job[DeliverChannelArgs]) error
type DeliverMailArgs ¶
type DeliverMailArgs struct {
DeliveryID int64 `json:"delivery_id" river:"unique"`
}
func (DeliverMailArgs) EnqueueOptions ¶
func (DeliverMailArgs) EnqueueOptions() supportjobs.EnqueueOptions
func (DeliverMailArgs) Kind ¶
func (DeliverMailArgs) Kind() string
type DeliverMailWorker ¶
type DeliverMailWorker struct {
river.WorkerDefaults[DeliverMailArgs]
Store DeliveryStore
Providers ProviderResolver
Sender ProviderSender
}
func (*DeliverMailWorker) Work ¶
func (w *DeliverMailWorker) Work(ctx context.Context, job *river.Job[DeliverMailArgs]) error
type DeliveryStore ¶
type DeliveryStore interface {
GetDelivery(context.Context, int64) (notifications.MailDelivery, error)
UpdateDelivery(context.Context, notifications.DeliveryUpdate) error
}
type ProviderResolver ¶
type ProviderResolver interface {
Resolve(context.Context) (extensionsruntime.MailProviderSelection, extensionsruntime.MailProviderState, error)
}
type ProviderSender ¶
type ProviderSender interface {
SendMail(context.Context, string, extensionsruntime.MailProviderRequest) (extensionsruntime.MailProviderResponse, error)
}
Click to show internal directories.
Click to hide internal directories.