model

package
v0.0.0-...-2fa74ab Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Id        string    `bson:"_id" db:"id" json:"id,omitempty" validate:"uuid"`
	Username  string    `bson:"username" db:"username" json:"username" validate:"required,min=3"`
	Password  string    `bson:"password" db:"password" json:"password,omitempty" validate:"required,min=8"`
	CreatedAt time.Time `bson:"createdAt" db:"created_at" json:"createdAt"`
	UpdatedAt time.Time `bson:"updatedAt" db:"updated_at" json:"updatedAt"`
}

func NewUserModel

func NewUserModel(username, password string) *User

func (User) Validate

func (u User) Validate() error

func (User) ValidatePassword

func (u User) ValidatePassword() error

func (User) ValidateUsername

func (u User) ValidateUsername() error

Jump to

Keyboard shortcuts

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