utils

package
v0.0.0-...-587043a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBookStatus

func CheckBookStatus(db *pgx.Conn, bookID string) (bool, error)

func CheckDate

func CheckDate(db *pgx.Conn, borrowID string) (int, error)

func CheckDebit

func CheckDebit(db *pgx.Conn, studentID string) (bool, error)

func CheckEmployeeMailExist

func CheckEmployeeMailExist(db *pgx.Conn, mail string) (bool, error)

func CheckExtend

func CheckExtend(db *pgx.Conn, borrowID string) (bool, error)

func CheckIdValue

func CheckIdValue(db *pgx.Conn, tableName, columnName, idValue string) (bool, error)

func CheckLimit

func CheckLimit(db *pgx.Conn, studentID string) (bool, error)

func CheckMailValid

func CheckMailValid(email string) bool

func CheckStudentBanStatus

func CheckStudentBanStatus(db *pgx.Conn, email string) (bool, error)

func CheckStudentMailExist

func CheckStudentMailExist(db *pgx.Conn, mail string) (bool, error)

func DecryptPassword

func DecryptPassword(hashedPassword, password string) error

func EncryptPassword

func EncryptPassword(password string) (string, error)

func GenerateEmployeeJWT

func GenerateEmployeeJWT(employeeID string) (string, error)

func GeneratePasswordResetToken

func GeneratePasswordResetToken(studentID string) (string, error)

func GenerateStudentJWT

func GenerateStudentJWT(studentID string) (string, error)

func GenerateUniqueID

func GenerateUniqueID() string

func SendPasswordResetEmail

func SendPasswordResetEmail(email, token string) error

func UpdateDebit

func UpdateDebit(db *pgx.Conn, studentID string, additionalDebit int) error

func UpdateExtend

func UpdateExtend(db *pgx.Conn, borrowID string) (bool, error)

func UpdateLimit

func UpdateLimit(db *pgx.Conn, studentID string, updateType string) error

func ValidatePasswordResetToken

func ValidatePasswordResetToken(tokenString string) (string, error)

Types

type EmployeeClaims

type EmployeeClaims struct {
	EmployeeID string `json:"employee_id"`
	jwt.StandardClaims
}

func ValidateEmployeeJWT

func ValidateEmployeeJWT(tokenString string) (*EmployeeClaims, error)

type ResetPasswordClaims

type ResetPasswordClaims struct {
	StudentID string `json:"student_id"`
	jwt.StandardClaims
}

type StudentClaims

type StudentClaims struct {
	StudentID string `json:"student_id"`
	jwt.StandardClaims
}

func ValidateStudentJWT

func ValidateStudentJWT(tokenString string) (*StudentClaims, error)

Jump to

Keyboard shortcuts

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