Documentation
¶
Overview ¶
Package shared provides value types and normalization shared by subdomains.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDuplicateTag = errors.New("duplicate tag")
ErrDuplicateTag indicates a repeated normalized tag.
var ErrInvalidEntityMetadata = errors.New("invalid entity metadata")
ErrInvalidEntityMetadata identifies missing or nonchronological lifecycle times.
var ErrInvalidTag = errors.New("invalid tag")
ErrInvalidTag indicates an invalid tag.
var ErrInvalidTitle = errors.New("invalid title")
ErrInvalidTitle indicates an invalid title.
Functions ¶
Types ¶
type EntityMetadata ¶
type EntityMetadata struct {
// contains filtered or unexported fields
}
EntityMetadata is an immutable value object describing an entity's lifetime.
func NewEntityMetadata ¶
func NewEntityMetadata(createdAt, updatedAt time.Time) (EntityMetadata, error)
NewEntityMetadata requires nonzero times with update at or after creation. Stored instants use UTC and omit monotonic clock readings.
func (EntityMetadata) CreatedAt ¶
func (metadata EntityMetadata) CreatedAt() time.Time
CreatedAt returns the original creation instant in UTC.
func (EntityMetadata) IsZero ¶
func (metadata EntityMetadata) IsZero() bool
IsZero reports whether lifecycle metadata is uninitialized.
func (EntityMetadata) Updated ¶
func (metadata EntityMetadata) Updated(at time.Time) (EntityMetadata, error)
Updated returns a copy with a later or equal update time.
func (EntityMetadata) UpdatedAt ¶
func (metadata EntityMetadata) UpdatedAt() time.Time
UpdatedAt returns the most recent update instant in UTC.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag is a value object representing a normalized tag.
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
Tags is a value object: an immutable, ordered collection of unique tags. Its zero value is a valid empty collection.