vo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidNetworkAddress  = errors.NewValidationError("invalid network address")
	ErrNoIpAssociatedWithHost = errors.NewValidationError("no IPs associated with the hostname")
)
View Source
var (
	ErrCouldNotConvertPort = errors.NewValidationError("could not convert port to integer")
	ErrInvalidPort         = errors.NewValidationError("invalid port, port is out of the allowed range (0-65535)")
	ErrPortNotNumber       = errors.NewValidationError("port is not a number")
)
View Source
var (
	ErrPasswordIsTooShort         = errors.NewValidationError("password is too short, must be at least 8 characters long")
	ErrPasswordUppercaseLetter    = errors.NewValidationError("password must include at least one uppercase letter")
	ErrPasswordLowercaseLetter    = errors.NewValidationError("password must include at least one lowercase letter")
	ErrPasswordAtLeastOneDigit    = errors.NewValidationError("password must include at least one digit")
	ErrPasswordAtLeastSpecialChar = errors.NewValidationError("password must include at least one special character")
)
View Source
var (
	ErrInvalidCnpj = errors.NewValidationError("invalid CNPJ")
)
View Source
var (
	ErrInvalidCpf = errors.NewValidationError("invalid CPF")
)
View Source
var (
	ErrInvalidEmail = errors.NewValidationError("invalid email address")
)
View Source
var (
	ErrInvalidName = errors.NewValidationError("invalid name")
)
View Source
var (
	ErrInvalidPhone = errors.NewValidationError("invalid phone number")
)

Functions

This section is empty.

Types

type Cnpj

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

Cnpj struct

func NewCnpjVo

func NewCnpjVo(value string) (*Cnpj, error)

NewCnpjVo constructs a new Cnpj value object

func (Cnpj) Value

func (vo Cnpj) Value() string

type Cpf

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

Cpf struct

func NewCpfVo

func NewCpfVo(value string) (*Cpf, error)

NewCpfVo constructs a new Cpf value object

func (Cpf) Value

func (vo Cpf) Value() string

type Email

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

Email struct

func NewEmailVo

func NewEmailVo(value string) (*Email, error)

NewEmailVo constructs a new Email value object

func (Email) Value

func (vo Email) Value() string

type ID

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

func CreateID

func CreateID() *ID

CreateID cria um novo UUID de ID

func NewID

func NewID(value interface{}) (*ID, error)

NewID cria uma nova instância de ID com base no valor fornecido.

func (ID) Value

func (id ID) Value() uuid.UUID

Value retorna o valor UUID de ID.

type Name

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

func NewNameVo

func NewNameVo(value string) (*Name, error)

func (Name) Value

func (vo Name) Value() string

type NetworkAddress

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

func NewNetworkAddress

func NewNetworkAddress(ctx context.Context, host string) (*NetworkAddress, error)

NewNetworkAddress creates a new NetworkAddress instance and validates the host

func (NetworkAddress) Value

func (n NetworkAddress) Value() string

type NetworkPort

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

NetworkPort estrutura que representa uma porta de rede

func NewNetworkPortVo

func NewNetworkPortVo(value any) (*NetworkPort, error)

NewNetworkPortVo cria uma nova instância de NetworkPort após validação

func (NetworkPort) Value

func (n NetworkPort) Value() int

Value retorna o valor da porta de rede

type PasswordVo

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

func NewPasswordVo

func NewPasswordVo(password string) (*PasswordVo, error)

func (PasswordVo) Value

func (p PasswordVo) Value() string

type Phone

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

Phone struct

func NewPhoneVo

func NewPhoneVo(value string) (*Phone, error)

NewPhoneVo constructs a new Phone value object

func (Phone) Value

func (vo Phone) Value() string

Jump to

Keyboard shortcuts

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