Documentation
¶
Overview ¶
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Package identification provides value objects related to identification.
Index ¶
- type DateOfBirth
- type DateOfDeath
- func (dod DateOfDeath) Date() time.Time
- func (dod DateOfDeath) Equals(other DateOfDeath) bool
- func (dod DateOfDeath) Format(layout string) string
- func (dod DateOfDeath) IsEmpty() bool
- func (dod DateOfDeath) IsRecent() bool
- func (dod DateOfDeath) String() string
- func (dod DateOfDeath) TimeSinceDeath() int
- type Gender
- type ID
- type Name
- type Password
- type Username
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateOfBirth ¶
type DateOfBirth struct {
// contains filtered or unexported fields
}
DateOfBirth represents a date of birth value object
func NewDateOfBirth ¶
func NewDateOfBirth(year, month, day int) (DateOfBirth, error)
NewDateOfBirth creates a new DateOfBirth with validation
func ParseDateOfBirth ¶
func ParseDateOfBirth(dateStr string) (DateOfBirth, error)
ParseDateOfBirth creates a new DateOfBirth from a string in format "YYYY-MM-DD"
func (DateOfBirth) Age ¶
func (dob DateOfBirth) Age() int
Age calculates the age based on the date of birth and current date
func (DateOfBirth) Date ¶
func (dob DateOfBirth) Date() time.Time
Date returns the underlying time.Time value
func (DateOfBirth) Equals ¶
func (dob DateOfBirth) Equals(other DateOfBirth) bool
Equals checks if two DateOfBirth values are equal
func (DateOfBirth) Format ¶
func (dob DateOfBirth) Format(layout string) string
Format returns the date formatted according to the given layout
func (DateOfBirth) IsAdult ¶
func (dob DateOfBirth) IsAdult() bool
IsAdult checks if the person is an adult (18 years or older)
func (DateOfBirth) IsEmpty ¶
func (dob DateOfBirth) IsEmpty() bool
IsEmpty checks if the DateOfBirth is empty (zero value)
func (DateOfBirth) String ¶
func (dob DateOfBirth) String() string
String returns the string representation of the DateOfBirth
type DateOfDeath ¶
type DateOfDeath struct {
// contains filtered or unexported fields
}
DateOfDeath represents a date of death value object
func NewDateOfDeath ¶
func NewDateOfDeath(year, month, day int) (DateOfDeath, error)
NewDateOfDeath creates a new DateOfDeath with validation
func ParseDateOfDeath ¶
func ParseDateOfDeath(dateStr string) (DateOfDeath, error)
ParseDateOfDeath creates a new DateOfDeath from a string in format "YYYY-MM-DD"
func (DateOfDeath) Date ¶
func (dod DateOfDeath) Date() time.Time
Date returns the underlying time.Time value
func (DateOfDeath) Equals ¶
func (dod DateOfDeath) Equals(other DateOfDeath) bool
Equals checks if two DateOfDeath values are equal
func (DateOfDeath) Format ¶
func (dod DateOfDeath) Format(layout string) string
Format returns the date formatted according to the given layout
func (DateOfDeath) IsEmpty ¶
func (dod DateOfDeath) IsEmpty() bool
IsEmpty checks if the DateOfDeath is empty (zero value)
func (DateOfDeath) IsRecent ¶
func (dod DateOfDeath) IsRecent() bool
IsRecent checks if the death occurred within the last year
func (DateOfDeath) String ¶
func (dod DateOfDeath) String() string
String returns the string representation of the DateOfDeath
func (DateOfDeath) TimeSinceDeath ¶
func (dod DateOfDeath) TimeSinceDeath() int
TimeSinceDeath calculates the time elapsed since death in years
type Gender ¶
type Gender string
Gender represents a person's gender value object
type Password ¶
type Password struct {
// contains filtered or unexported fields
}
Password represents a password value object It stores the hashed password, not the plain text
func NewPassword ¶
NewPassword creates a new Password with validation and hashing
func (Password) Equals ¶
Equals checks if two Password values are equal This compares the underlying hashed passwords
func (Password) HashedPassword ¶
HashedPassword returns the base64-encoded hashed password
type Username ¶
type Username string
Username represents a username value object
func NewUsername ¶
NewUsername creates a new Username with validation
func (Username) ContainsSubstring ¶
ContainsSubstring checks if the username contains the given substring (case insensitive)