Documentation
¶
Overview ¶
Package notification provides a core business API.
Index ¶
- Variables
- type Core
- func (c *Core) Create(nn NewNotification) (Notification, error)
- func (c *Core) CreateTx(nnTx NewNotificationTx) (Notification, error)
- func (c *Core) Delete(ntf Notification) error
- func (c *Core) Query(pageNumber int, rowsPerPage int, topicID uuid.UUID) ([]Notification, error)
- func (c *Core) QueryByID(id uuid.UUID) (Notification, error)
- type NewNotification
- type NewNotificationTx
- type Notification
- type Storer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("notification not found")
)
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core manages the set of APIs for notification access.
func (*Core) Create ¶
func (c *Core) Create(nn NewNotification) (Notification, error)
Create adds a new notification to the system.
func (*Core) CreateTx ¶
func (c *Core) CreateTx(nnTx NewNotificationTx) (Notification, error)
func (*Core) Delete ¶
func (c *Core) Delete(ntf Notification) error
Delete removes the specified notification.
type NewNotification ¶
NewNotification contains information needed to create a new notification.
type NewNotificationTx ¶
type NewNotificationTx struct {
NewNotification
AfterCreate func(ntf Notification) error
}
NewNotificationTx contains information needed to create a new notification in a transaction.
type Notification ¶
Notification represents information about an individual notification.
type Storer ¶
type Storer interface {
WithinTran(fn func(s Storer) error) error
Create(ntf Notification) error
Delete(ntf Notification) error
Query(pageNumber int, rowsPerPage int, topicID uuid.UUID) ([]Notification, error)
QueryByID(id uuid.UUID) (Notification, error)
}
Storer interface declares the behavior this package needs to perists and retrieve data.
Click to show internal directories.
Click to hide internal directories.