notifications

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Insert(ctx context.Context, notification NewNotification) (Notification, error)
	List(ctx context.Context, cursor NotificationCursor) (NotificationPage, error)
	Read(ctx context.Context, notificationID uuid.UUID) error
	ReadAll(ctx context.Context) error
}

DB tells how application works with notifications database.

architecture: Database

type NewNotification

type NewNotification struct {
	SenderID storj.NodeID
	Type     NotificationType
	Title    string
	Message  string
}

NewNotification holds notification entity info which is being received from satellite or local client.

type Notification

type Notification struct {
	ID        uuid.UUID
	SenderID  storj.NodeID
	Type      NotificationType
	Title     string
	Message   string
	ReadAt    *time.Time
	CreatedAt time.Time
}

Notification holds notification entity info which is being retrieved from database.

type NotificationCursor

type NotificationCursor struct {
	Limit uint
	Page  uint
}

NotificationCursor holds notification cursor entity which is used to create listed page from database.

type NotificationPage

type NotificationPage struct {
	Notifications []Notification

	Offset      uint64
	Limit       uint
	CurrentPage uint
	PageCount   uint
	TotalCount  uint64
}

NotificationPage holds notification page entity which is used to show listed page of notifications on UI.

type NotificationType

type NotificationType int

NotificationType is a numeric value of specific notification type.

const (
	// NotificationTypeCustom is a common notification type which doesn't describe node's core functionality.
	// TODO: change type name when all notification types will be known
	NotificationTypeCustom NotificationType = 0
	// NotificationTypeAuditCheckFailure is a notification type which describes node's audit check failure.
	NotificationTypeAuditCheckFailure NotificationType = 1
	// NotificationTypeUptimeCheckFailure is a notification type which describes node's uptime check failure.
	NotificationTypeUptimeCheckFailure NotificationType = 2
	// NotificationTypeDisqualification is a notification type which describes node's disqualification status.
	NotificationTypeDisqualification NotificationType = 3
)

Jump to

Keyboard shortcuts

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