models

package
v0.0.0-...-c4be96f Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*Auth) SignIn

func (auth *Auth) SignIn() (*User, string, error)

type User

type User struct {
	ID        string     `gorm:"primaryKey"json:"id"`
	Name      string     `gorm:""json:"name"`
	Email     string     `json:"email"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index"json:"deleted_at"`
	Password  string     `json:"password"`
}

func DeleteUser

func DeleteUser(Id string) User

func GetAllUsers

func GetAllUsers(pagination *utils.Pagination) ([]User, *utils.Pagination)

func GetUserById

func GetUserById(Id string) (*User, *gorm.DB)

func UpdateUser

func UpdateUser(Id string, user User) User

func (*User) BeforeCreate

func (user *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) CreateUser

func (user *User) CreateUser() *User

Jump to

Keyboard shortcuts

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