feat: backend service
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package notification
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrNotificationNotFound is returned by AdminGetNotification when no
|
||||
// row matches the supplied identifier. Handlers map it to HTTP 404.
|
||||
var ErrNotificationNotFound = errors.New("notification: notification not found")
|
||||
|
||||
// ErrUnknownKind is returned by Submit when the intent's Kind is not in
|
||||
// the catalog (`backend/README.md` §10). Submit does not surface it to
|
||||
// the producer — it persists a malformed-intent record and returns nil.
|
||||
// The exported sentinel exists so the package internals can branch on it.
|
||||
var ErrUnknownKind = errors.New("notification: unknown kind")
|
||||
|
||||
// ErrEmptyIdempotencyKey is returned by Submit when the intent does not
|
||||
// carry an idempotency_key. Same surface treatment as ErrUnknownKind.
|
||||
var ErrEmptyIdempotencyKey = errors.New("notification: idempotency_key must be non-empty")
|
||||
|
||||
// ErrNoRecipients is returned by Submit when a kind that requires user
|
||||
// recipients arrives without any. Same surface treatment as
|
||||
// ErrUnknownKind.
|
||||
var ErrNoRecipients = errors.New("notification: at least one recipient is required")
|
||||
Reference in New Issue
Block a user