notificationjobs

package
v0.0.0-...-e12325a Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebPushProviderSlot     = "notification.channel.web_push"
	WebPushProviderContract = "sforum.web-push.channel@1"
	WebPushProviderInput    = "sforum.web-push.channel.request@1"
)

Variables

View Source
var ErrChannelProviderUnavailable = errors.New("notification channel provider is unavailable")

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 ChannelProviderRequest struct {
	SlotID, ContractVersion, InputSchema string
	Input                                map[string]any
}

type ChannelProviderResult

type ChannelProviderResult struct {
	ExtensionID, ArtifactDigest string
	Output                      map[string]any
}

type DeliverChannelArgs

type DeliverChannelArgs struct {
	DeliveryID int64 `json:"delivery_id" river:"unique"`
}

func (DeliverChannelArgs) EnqueueOptions

func (DeliverChannelArgs) Kind

func (DeliverChannelArgs) Kind() string

type DeliverChannelWorker

type DeliverChannelWorker struct {
	river.WorkerDefaults[DeliverChannelArgs]
	Store   ChannelDeliveryStore
	Invoker ChannelProviderInvoker
}

func (*DeliverChannelWorker) Work

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

type DeliveryStore

type DeliveryStore interface {
	GetDelivery(context.Context, int64) (notifications.MailDelivery, error)
	UpdateDelivery(context.Context, notifications.DeliveryUpdate) error
}

Jump to

Keyboard shortcuts

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