32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
// Package ports defines the storage-agnostic boundaries used by the user
|
|
// service.
|
|
package ports
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
var (
|
|
// ErrNotFound reports that a requested source-of-truth record does not
|
|
// exist in the dependency behind the port.
|
|
ErrNotFound = errors.New("ports: record not found")
|
|
|
|
// ErrConflict reports that a create or update cannot be applied because the
|
|
// dependency state conflicts with the requested mutation.
|
|
ErrConflict = errors.New("ports: conflict")
|
|
|
|
// ErrInvalidPageToken reports that a supplied pagination token cannot be
|
|
// decoded or does not match the expected filter set.
|
|
ErrInvalidPageToken = errors.New("ports: invalid page token")
|
|
)
|
|
|
|
var (
|
|
// ErrUserNameConflict reports that a mutation specifically failed because
|
|
// the auto-generated `user_name` lookup is already owned by another user.
|
|
// The sentinel still matches ErrConflict via errors.Is so callers can
|
|
// preserve the stable public conflict semantics while collecting more
|
|
// precise observability.
|
|
ErrUserNameConflict = fmt.Errorf("%w: user name conflict", ErrConflict)
|
|
)
|