db

package
v0.0.0-...-523dd65 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUser

func AuthenticateUser(dbs *sql.DB, username, password string) (bool, error)

func CloseDB

func CloseDB(dbs *sql.DB)

func ConnectToDB

func ConnectToDB(dbName string) (*sql.DB, error)

func CreateMigrationsTable

func CreateMigrationsTable(dbs *sql.DB)

func CreateUser

func CreateUser(dbs *sql.DB, users Users) (user Users, userInfo UserInfo, err error)

func GetUser

func GetUser(dbs *sql.DB) (user Users, userInfo UserInfo, err error)

func GetUserFromUsername

func GetUserFromUsername(dbs *sql.DB, username string) (user Users, userInfo UserInfo, err error)

Types

type UserInfo

type UserInfo struct {
	User_id    int    `json:"user_id"`
	UserRank   string `json:"user_rank"`
	UserPoints int    `json:"user_points"`
}

type Users

type Users struct {
	Id       int    `json:"id"`
	Username string `json:"username" form:"username"`
	Email    string `json:"email" form:"email"`
	Password string `json:"password" form:"password"`
}

Jump to

Keyboard shortcuts

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