domain

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentials = errors.New("Informed credentials are invalid")
View Source
var ErrInvalidEmail = errors.New("invalid email")
View Source
var ErrInvalidPassword = errors.New("invalid Password")
View Source
var ErrInvalidPasswordLenght = errors.New("password length is lower than 8")
View Source
var ErrInvalidUserID = errors.New("invalid User id")
View Source
var ErrInvalidUsername = errors.New("invalid Username")

Functions

This section is empty.

Types

type EmailValueObject

type EmailValueObject struct {
	// contains filtered or unexported fields
}

func LoadEmail

func LoadEmail(value string) (*EmailValueObject, error)

func NewEmail

func NewEmail(value string) (*EmailValueObject, error)

func (*EmailValueObject) GetValue

func (e *EmailValueObject) GetValue() string

type PasswordValueObject

type PasswordValueObject struct {
	// contains filtered or unexported fields
}

func LoadPassword

func LoadPassword(value string) (*PasswordValueObject, error)

func NewPassword

func NewPassword(value string) (*PasswordValueObject, error)

func (*PasswordValueObject) ComparePassword

func (p *PasswordValueObject) ComparePassword(pass string) error

func (*PasswordValueObject) String

func (p *PasswordValueObject) String() string

type User

type User struct {
	// contains filtered or unexported fields
}

func LoadUser

func LoadUser(id *uuid.UUID, userName *UsernameValueObject, email *EmailValueObject, password *PasswordValueObject) (*User, error)

func NewUser

func NewUser(userName *UsernameValueObject, email *EmailValueObject, password *PasswordValueObject) (*User, error)

func (*User) GetEmail

func (u *User) GetEmail() *EmailValueObject

func (*User) GetID

func (u *User) GetID() string

func (*User) GetPassword

func (u *User) GetPassword() *PasswordValueObject

func (*User) GetUsername

func (u *User) GetUsername() string

func (*User) Login

func (u *User) Login()

func (*User) ValidateCredentials

func (u *User) ValidateCredentials(password string) error

type UsernameValueObject

type UsernameValueObject struct {
	// contains filtered or unexported fields
}

func LoadUsername

func LoadUsername(value string) (*UsernameValueObject, error)

func NewUsername

func NewUsername(value string) (*UsernameValueObject, error)

func (*UsernameValueObject) GetValue

func (u *UsernameValueObject) GetValue() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL