user

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 8 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           int    `json:"id"`
	GroupID      int    `json:"group_id"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	Email        string `json:"email"`
	Phone        string `json:"phone"`
	Contact      string `json:"contact"`
	EncryteToken string `json:"encryte_token"`
	Status       int    `json:"status"`
	CreatedAt    int64  `json:"created_at"`
	UpdatedAt    int64  `json:"updated_at"`
}

type Users

type Users struct {
	EnableTPA bool
	// contains filtered or unexported fields
}

func NewUsers

func NewUsers(db *sql.DB, kv *kv.Client, enableTPA bool) (*Users, error)

func (*Users) Check

func (u *Users) Check(user User) (bool, error)

func (*Users) CheckByUsernameAndPassword

func (u *Users) CheckByUsernameAndPassword(username, password string) (User, error)

func (*Users) CheckStatus

func (u *Users) CheckStatus(id int) (bool, error)

func (*Users) Delete

func (u *Users) Delete(id int) error

func (*Users) Insert

func (u *Users) Insert(user *User) error

func (*Users) Login

func (u *Users) Login(w http.ResponseWriter, r *http.Request)

func (*Users) LoginSession

func (u *Users) LoginSession(w http.ResponseWriter, r *http.Request)

func (*Users) SearchByEmail

func (u *Users) SearchByEmail(email string) (User, error)

func (*Users) SearchByID

func (u *Users) SearchByID(id int) (User, error)

func (*Users) Update

func (u *Users) Update(user *User) error

Jump to

Keyboard shortcuts

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