Documentation
¶
Overview ¶
Package shared provides shared domain types and utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrAlreadyExists = errors.New("already exists") ErrInvalidInput = errors.New("invalid input") ErrForbidden = errors.New("forbidden") ErrInternal = errors.New("internal error") ErrConflict = errors.New("conflict") ErrValidation = errors.New("validation error") )
Domain errors.
Functions ¶
func IsAlreadyExists ¶
IsAlreadyExists checks if the error is an already exists error.
func IsNotFound ¶
IsNotFound checks if the error is a not found error.
func IsValidation ¶
IsValidation checks if the error is a validation error.
Types ¶
type DomainError ¶
DomainError represents a domain-specific error.
func NewDomainError ¶
func NewDomainError(code, message string, err error) *DomainError
NewDomainError creates a new DomainError.
func (*DomainError) Error ¶
func (e *DomainError) Error() string
Error implements the error interface.
func (*DomainError) Unwrap ¶
func (e *DomainError) Unwrap() error
Unwrap returns the underlying error.
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID represents a unique identifier for domain entities.
func IDFromString ¶
IDFromString creates an ID from a string.
func MustIDFromString ¶
MustIDFromString creates an ID from a string, panics on error.
func (ID) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.