notification

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger = common.Logger

Logger is the fundamental interface for all log operations.

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock for the Service type.

func (*MockService) GetNotifications

func (_m *MockService) GetNotifications(ctx context.Context) (notifications Notifications, err error)

GetNotifications provides a mock function.

type NoopLogger

type NoopLogger = common.NoopLogger

NoopLogger is a logger that discards every log event.

type Notification

type Notification struct {
	ID       uint   `json:"id"`
	Message  string `json:"message"`
	Priority int8   `json:"priority"`
}

Notification represents a single notification.

type Notifications

type Notifications struct {
	Messages []Notification `json:"messages"`
}

Notifications is the list of notifications active.

type Service

type Service interface {
	// GetNotifications returns the list of notifications.
	GetNotifications(ctx context.Context) (notifications Notifications, err error)
}

Service provides an interface to notifications.

func NewService

func NewService(store Store) Service

NewService returns a new Service.

type Store

type Store interface {
	// GetActiveNotifications returns the list of active notifications.
	GetActiveNotifications(ctx context.Context) ([]Notification, error)
}

Store is a data persistence layer for notifications.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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