Documentation
¶
Overview ¶
Package contact provides value objects related to contact information.
Package contact provides value objects related to contact information.
Package contact provides value objects related to contact information.
Index ¶
- type Address
- type Email
- type Phone
- func (p Phone) CountryCode() string
- func (p Phone) Equals(other Phone) bool
- func (p Phone) Format(format string) string
- func (p Phone) IsEmpty() bool
- func (p Phone) IsValidForCountry(countryCode string) bool
- func (p Phone) Normalized() string
- func (p Phone) String() string
- func (p Phone) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address string
Address represents a postal address value object
func NewAddress ¶
NewAddress creates a new Address with validation
type Email ¶
type Email string
Email represents an email address value object
type Phone ¶
type Phone string
Phone represents a phone number value object
func (Phone) CountryCode ¶
CountryCode returns the country code of the phone number
func (Phone) Format ¶
Format formats the phone number according to the specified format Supported formats: - "e164": E.164 format (e.g., "+12345678901") - "national": National format (e.g., "(234) 567-8901") - "international": International format (e.g., "+1 234 567 8901") If an unsupported format is specified, the phone number is returned as is.
func (Phone) IsValidForCountry ¶
IsValidForCountry checks if the phone number is valid for the specified country
func (Phone) Normalized ¶
Normalized returns the phone number in E.164 format