notification

package
v0.0.0-...-c95fea6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseNotificationStore

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

func NewDatabaseNotificationStore

func NewDatabaseNotificationStore(txImpl dbmodel.ITransaction, metaDomain dbmodel.IMetaDomain) *DatabaseNotificationStore

func (*DatabaseNotificationStore) AddNotification

func (d *DatabaseNotificationStore) AddNotification(ctx context.Context, notification model.Notification) error

func (*DatabaseNotificationStore) GetAllPendingNotifications

func (d *DatabaseNotificationStore) GetAllPendingNotifications(ctx context.Context) (map[string][]model.Notification, error)

func (*DatabaseNotificationStore) GetNotifications

func (d *DatabaseNotificationStore) GetNotifications(ctx context.Context, collectionID string) ([]model.Notification, error)

func (*DatabaseNotificationStore) RemoveNotifications

func (d *DatabaseNotificationStore) RemoveNotifications(ctx context.Context, notification []model.Notification) error

type MemoryNotificationStore

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

func NewMemoryNotificationStore

func NewMemoryNotificationStore() *MemoryNotificationStore

func (*MemoryNotificationStore) AddNotification

func (m *MemoryNotificationStore) AddNotification(ctx context.Context, notification model.Notification) error

func (*MemoryNotificationStore) GetAllPendingNotifications

func (m *MemoryNotificationStore) GetAllPendingNotifications(ctx context.Context) (map[string][]model.Notification, error)

func (*MemoryNotificationStore) GetNotifications

func (m *MemoryNotificationStore) GetNotifications(ctx context.Context, collectionID string) ([]model.Notification, error)

func (*MemoryNotificationStore) RemoveNotifications

func (m *MemoryNotificationStore) RemoveNotifications(ctx context.Context, notifications []model.Notification) error

type MemoryNotifier

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

func NewMemoryNotifier

func NewMemoryNotifier() *MemoryNotifier

func (*MemoryNotifier) Notify

func (m *MemoryNotifier) Notify(ctx context.Context, notifications []model.Notification) error

type NotificationProcessor

type NotificationProcessor interface {
	common.Component
	Process(ctx context.Context) error
	Trigger(ctx context.Context, triggerMsg TriggerMessage)
}

type NotificationStore

type NotificationStore interface {
	GetAllPendingNotifications(ctx context.Context) (map[string][]model.Notification, error)
	GetNotifications(ctx context.Context, collecitonID string) ([]model.Notification, error)
	AddNotification(ctx context.Context, notification model.Notification) error
	RemoveNotifications(ctx context.Context, notifications []model.Notification) error
}

type Notifier

type Notifier interface {
	Notify(ctx context.Context, notifications []model.Notification) error
}

type PulsarNotifier

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

func NewPulsarNotifier

func NewPulsarNotifier(producer pulsar.Producer) *PulsarNotifier

func (*PulsarNotifier) Notify

func (p *PulsarNotifier) Notify(ctx context.Context, notifications []model.Notification) error

type SimpleNotificationProcessor

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

func NewSimpleNotificationProcessor

func NewSimpleNotificationProcessor(ctx context.Context, store NotificationStore, notifier Notifier) *SimpleNotificationProcessor

func (*SimpleNotificationProcessor) Process

func (*SimpleNotificationProcessor) Start

func (*SimpleNotificationProcessor) Stop

func (*SimpleNotificationProcessor) Trigger

func (n *SimpleNotificationProcessor) Trigger(ctx context.Context, triggerMsg TriggerMessage)

type TriggerMessage

type TriggerMessage struct {
	Msg        model.Notification
	ResultChan chan error
}

Jump to

Keyboard shortcuts

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