service

package
v4.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDelivery = errors.New("no delivery mechanisms configured")

ErrNoDelivery is returned when there's insufficient configuration for notification delivery.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	Notifications_       func(ctx context.Context, id uuid.UUID, page *notifier.Page) ([]notifier.Notification, notifier.Page, error)
	DeleteNotifications_ func(ctx context.Context, id uuid.UUID) error
}

Mock implements a mock notifier service

func (*Mock) DeleteNotifications

func (m *Mock) DeleteNotifications(ctx context.Context, id uuid.UUID) error

func (*Mock) Notifications

func (m *Mock) Notifications(ctx context.Context, id uuid.UUID, page *notifier.Page) ([]notifier.Notification, notifier.Page, error)

type Notifier added in v4.4.0

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier is a local implementation of a notifier service.

func New

func New(ctx context.Context, store notifier.Store, locks notifier.Locker, opts Opts) (*Notifier, error)

New returns a configured notifier subsystem.

func (*Notifier) DeleteNotifications added in v4.4.0

func (s *Notifier) DeleteNotifications(ctx context.Context, id uuid.UUID) error

DeleteNotifications implements notifier.Service.

func (*Notifier) Notifications added in v4.4.0

func (s *Notifier) Notifications(ctx context.Context, id uuid.UUID, page *notifier.Page) ([]notifier.Notification, notifier.Page, error)

Notifications implements notifier.Service.

func (*Notifier) Run added in v4.4.0

func (s *Notifier) Run(ctx context.Context) error

Run spawns all needed background goroutines and waits for the first error.

Canceling the supplied Context should return context.Canceled.

type Opts

type Opts struct {
	Matcher          matcher.Service
	Indexer          indexer.Service
	Client           *http.Client
	Webhook          *config.Webhook
	AMQP             *config.AMQP
	STOMP            *config.STOMP
	PollInterval     time.Duration
	DeliveryInterval time.Duration
	DisableSummary   bool
}

Opts configures the notifier service.

Notes

Bugs

  • Currently only one delivery mechanism can be configured at a time.

  • The garbage collection period is currently unconfigurable.

Jump to

Keyboard shortcuts

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