management

package
v0.0.0-...-5d77e96 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePassword

func ChangePassword(user *User, newPassword string, db *database.MySQL) error

func PrepareDB

func PrepareDB(db *database.MySQL)

func ResetPassword

func ResetPassword(user *User, db *database.MySQL) error

func UpdateUser

func UpdateUser(user *User, db *database.MySQL) error

func UserExists

func UserExists(db *database.MySQL, id int64) bool

Types

type User

type User struct {
	ID           int64
	Username     string
	FName        string
	LName        string
	LanguageCode string
	CreatedAt    time.Time
	IsAdmin      bool
	SQLUsername  string
	SQLPassword  string
	SQLDBName    string
	GeminiAPIKey string
}

func UserFromTelegram

func UserFromTelegram(user *telegram.User, db *database.MySQL) User

func (*User) AddToDataBase

func (u *User) AddToDataBase(db *database.MySQL)

func (*User) ExistsInDataBase

func (u *User) ExistsInDataBase(db *database.MySQL) bool

Proxy function to check if the user exists in the database

func (*User) GetDB

func (u *User) GetDB(db *database.MySQL) database.MySQL

func (*User) GetFromDataBase

func (u *User) GetFromDataBase(db *database.MySQL)

Jump to

Keyboard shortcuts

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