service

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, opts Opts) (*service, error)

New kicks off the notifier subsystem.

Canceling the ctx will kill any concurrent routines affiliated with the notifier.

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
	KeyStore_            func(ctx context.Context) notifier.KeyStore
	KeyManager_          func(ctx context.Context) *keymanager.Manager
}

Mock implements a mock notifier service

func (*Mock) DeleteNotifications

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

func (*Mock) KeyManager

func (m *Mock) KeyManager(ctx context.Context) *keymanager.Manager

func (*Mock) KeyStore

func (m *Mock) KeyStore(ctx context.Context) notifier.KeyStore

func (*Mock) Notifications

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

type Opts

type Opts struct {
	PollInterval     time.Duration
	DeliveryInterval time.Duration
	Migrations       bool
	ConnString       string
	Matcher          matcher.Service
	Indexer          indexer.Service
	DisableSummary   bool
	Client           *http.Client
	Webhook          *webhook.Config
	AMQP             *namqp.Config
	STOMP            *stomp.Config
}

Opts configures the notifier service

type Service

type Service interface {
	// Retrieves an optional paginated set of notifications given an notification id
	Notifications(ctx context.Context, id uuid.UUID, page *notifier.Page) ([]notifier.Notification, notifier.Page, error)
	// Deletes the provided notification id
	DeleteNotifications(ctx context.Context, id uuid.UUID) error
	// KeyStore returns the notifier's KeyStore.
	KeyStore(ctx context.Context) notifier.KeyStore
	// KeyManager returns the notifier's KeyManager.
	KeyManager(ctx context.Context) *keymanager.Manager
}

Service is an interface wrapping ClairV4's notifier functionality.

This remains an interface so remote clients may implement as well.

Jump to

Keyboard shortcuts

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