notification

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 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 CollectionExecutor

type CollectionExecutor interface {
	Execute() ([]contract.Notification, error)
}

func NewEndExecutor

func NewEndExecutor(db NotificationLoader, end int64, limit int) CollectionExecutor

func NewGetNewestExecutor

func NewGetNewestExecutor(db NotificationLoader, limit int) CollectionExecutor

func NewLabelsExecutor

func NewLabelsExecutor(db NotificationLoader, labels []string, limit int) CollectionExecutor

func NewSenderExecutor

func NewSenderExecutor(db NotificationLoader, sender string, limit int) CollectionExecutor

func NewStartEndExecutor

func NewStartEndExecutor(db NotificationLoader, start int64, end int64, limit int) CollectionExecutor

func NewStartExecutor

func NewStartExecutor(db NotificationLoader, start int64, limit int) CollectionExecutor

type DeleteExecutor

type DeleteExecutor interface {
	Execute() error
}

DeleteExecutor handles the deletion of a notification. Returns ErrNotificationNotFound if a notification could not be found with a matching ID

func NewDeleteByAgeExecutor

func NewDeleteByAgeExecutor(db NotificationDeleter, dage int) DeleteExecutor

NewDeleteBySlugExecutor creates a new DeleteExecutor which deletes a notifcation based on slug.

func NewDeleteByIDExecutor

func NewDeleteByIDExecutor(db NotificationDeleter, did string) DeleteExecutor

NewDeleteByIDExecutor creates a new DeleteExecutor which deletes a notifcation based on id.

func NewDeleteBySlugExecutor

func NewDeleteBySlugExecutor(db NotificationDeleter, dslug string) DeleteExecutor

NewDeleteBySlugExecutor creates a new DeleteExecutor which deletes a notifcation based on slug.

type IdExecutor

type IdExecutor interface {
	Execute() (contract.Notification, error)
}

func NewIdExecutor

func NewIdExecutor(db NotificationLoader, id string) IdExecutor

func NewSlugExecutor

func NewSlugExecutor(db NotificationLoader, slug string) IdExecutor

type NotificationDeleter

type NotificationDeleter interface {
	DeleteNotificationById(id string) error
	DeleteNotificationBySlug(slug string) error
	DeleteNotificationsOld(age int) error
}

NotificationDeleter deletes notifications.

type NotificationLoader

type NotificationLoader interface {
	GetNotificationById(id string) (contract.Notification, error)
	GetNotificationBySlug(slug string) (contract.Notification, error)
	GetNotificationBySender(sender string, limit int) ([]contract.Notification, error)
	GetNotificationsByStartEnd(start int64, end int64, limit int) ([]contract.Notification, error)
	GetNotificationsByStart(start int64, limit int) ([]contract.Notification, error)
	GetNotificationsByEnd(end int64, limit int) ([]contract.Notification, error)
	GetNotificationsByLabels(labels []string, limit int) ([]contract.Notification, error)
	GetNewNotifications(limit int) ([]contract.Notification, error)
}

NotificationLoader provides functionality for obtaining Notifications.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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