Documentation ¶
Index ¶
- func HasName(user User) bool
- func HasValidEmail(user User) bool
- type Location
- type PhoneNumber
- func (p *PhoneNumber) AreaCode() string
- func (p *PhoneNumber) CountryCode() string
- func (p PhoneNumber) IsEqual(p2 PhoneNumber) bool
- func (p *PhoneNumber) Number() string
- func (p *PhoneNumber) SetAreaCode(ac string)
- func (p *PhoneNumber) SetCountryCode(cc string)
- func (p *PhoneNumber) SetNumber(ph string)
- type Token
- func (t *Token) CompareTokenVerificationWithHash(h []byte) bool
- func (t *Token) CreateTokenVerificationHash() ([]byte, error)
- func (t *Token) IsValid() bool
- func (t *Token) RefreshVerificationSalt()
- func (t *Token) RefreshVerificationToken()
- func (t *Token) SetVerificationSalt(vs string)
- func (t *Token) SetVerificationToken(vt string)
- func (t *Token) VerificationSalt() string
- func (t *Token) VerificationToken() string
- type User
- func (u *User) DateOfBirth() time.Time
- func (u *User) Email() string
- func (u *User) ID() uuid.UUID
- func (u User) IsTheSameUserAs(u2 User) bool
- func (u User) IsValid() bool
- func (u *User) Name() (string, string)
- func (u *User) Phone() PhoneNumber
- func (u *User) SetDateOfBirth(dob time.Time)
- func (u *User) SetEmail(em string)
- func (u *User) SetID(id uuid.UUID)
- func (u *User) SetName(fn, ln string)
- func (u *User) SetPhone(ph PhoneNumber)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasValidEmail ¶
Types ¶
type Location ¶
Location is a value object referencing user's default location
func NewLocation ¶
func NewLocation() Location
func (*Location) SetCoordinates ¶
TODO: Validation of Value Object should happen during the creation only, and new changes should return a new one
type PhoneNumber ¶
type PhoneNumber struct {
// contains filtered or unexported fields
}
func NewEmptyPhoneNumber ¶
func NewEmptyPhoneNumber() PhoneNumber
func NewPhoneNumber ¶
func NewPhoneNumber(countryCode, areaCode, number string) PhoneNumber
TODO: Validation of value object should happen only on the creation side.
func (*PhoneNumber) AreaCode ¶
func (p *PhoneNumber) AreaCode() string
func (*PhoneNumber) CountryCode ¶
func (p *PhoneNumber) CountryCode() string
func (PhoneNumber) IsEqual ¶
func (p PhoneNumber) IsEqual(p2 PhoneNumber) bool
IsEqual checks whether or not two instances of PhoneNumber value object are equal or not by comparing all elements of the value objects with each other
func (*PhoneNumber) Number ¶
func (p *PhoneNumber) Number() string
func (*PhoneNumber) SetAreaCode ¶
func (p *PhoneNumber) SetAreaCode(ac string)
func (*PhoneNumber) SetCountryCode ¶
func (p *PhoneNumber) SetCountryCode(cc string)
func (*PhoneNumber) SetNumber ¶
func (p *PhoneNumber) SetNumber(ph string)
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func NewEmptyToken ¶
func NewEmptyToken() Token
func (*Token) CompareTokenVerificationWithHash ¶
CompareTokenVerificationWithHash compares the bcrypt-hashed verification token with the actual plain-text value and returns true if the match
func (*Token) CreateTokenVerificationHash ¶
CreateTokenVerificationHash hashes the token verification using bcrypt hash algorithm
func (*Token) RefreshVerificationSalt ¶
func (t *Token) RefreshVerificationSalt()
func (*Token) RefreshVerificationToken ¶
func (t *Token) RefreshVerificationToken()
func (*Token) SetVerificationSalt ¶
func (*Token) SetVerificationToken ¶
func (*Token) VerificationSalt ¶
func (*Token) VerificationToken ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func NewEmptyUser ¶
func NewEmptyUser() User
func (*User) DateOfBirth ¶
func (User) IsTheSameUserAs ¶
func (*User) Phone ¶
func (u *User) Phone() PhoneNumber
func (*User) SetDateOfBirth ¶
func (*User) SetPhone ¶
func (u *User) SetPhone(ph PhoneNumber)
Click to show internal directories.
Click to hide internal directories.