models

package
v0.0.0-...-4bc8cf8 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 2 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           primitive.ObjectID `bson:"_id,omitempty"`
	Username     string             `bson:"username" json:"username" binding:"required,min=3,max=20"`
	Email        string             `bson:"email" json:"email" binding:"required"`
	PasswordHash string             `bson:"password_hash" json:"-"`
	Fullname     string             `bson:"fullname" json:"fullname" binding:"required,min=1,max=20"`
	CreatedAt    time.Time          `bson:"created_at" json:"created_at"` // Timestamp of when the user was created
	UpdatedAt    time.Time          `bson:"updated_at" json:"updated_at"` // Timestamp of when the user was last updated
	IsActive     bool               `bson:"is_active" json:"is_active"`   // Is the user active
}

User represents a user in the system

type UserRequest

type UserRequest struct {
	Username string `bson:"username" json:"username" binding:"required,min=3,max=20"`
	Email    string `bson:"email" json:"email" binding:"required"`
	Password string `bson:"password" json:"password" binding:"required"`
	Fullname string `bson:"fullname" json:"fullname" binding:"required,min=1,max=20"`
}

type UserSigninRequest

type UserSigninRequest struct {
	Username string `bson:"username" json:"username" binding:"required,min=3,max=20"`
	Password string `bson:"password" json:"password" binding:"required"`
}

Jump to

Keyboard shortcuts

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