valueobj

package
v0.0.1-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PasswordMaxCharactersLength = "64"
View Source
const PasswordMinCharactersLength = "8"
View Source
const UsernameMaxCharactersLength = "20"
View Source
const UsernameMinCharactersLength = "2"

Variables

This section is empty.

Functions

func InvalidEmail

func InvalidEmail() (string, error)

func InvalidId

func InvalidId() (string, error)

func NewEmail

func NewEmail(email string) (models.ValueObject[string], error)

func NewId

func NewId(id string) (models.ValueObject[string], error)

func NewPassword

func NewPassword(password string) (models.ValueObject[string], error)

func NewUsername

func NewUsername(username string) (models.ValueObject[string], error)

func NewVerified

func NewVerified(verified bool) (models.ValueObject[bool], error)

func RandomEmail

func RandomEmail() (models.ValueObject[string], error)

func RandomId

func RandomId() (models.ValueObject[string], error)

func RandomPassword

func RandomPassword() (models.ValueObject[string], error)

func RandomUsername

func RandomUsername() (models.ValueObject[string], error)

func WithInvalidPasswordLength

func WithInvalidPasswordLength() (string, error)

func WithInvalidUsernameAlphanumeric

func WithInvalidUsernameAlphanumeric() (string, error)

func WithInvalidUsernameLength

func WithInvalidUsernameLength() (string, error)

Types

type Password

type Password struct {
	Password string `validate:"gte=8,lte=64"`
}

func (*Password) IsValid

func (password *Password) IsValid() error

func (*Password) Value

func (password *Password) Value() string

type Username

type Username struct {
	Username string `validate:"gte=2,lte=20,alphanum"`
}

func (*Username) IsValid

func (username *Username) IsValid() error

func (*Username) Value

func (username *Username) Value() string

type Verified

type Verified struct {
	Verified bool
}

func (*Verified) IsValid

func (verified *Verified) IsValid() error

func (*Verified) Value

func (verified *Verified) Value() bool

Jump to

Keyboard shortcuts

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