Version: v0.0.0-...-c12dc61 Latest Latest

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 5 Imported by: 0




View Source
const DB string = "./server/database.db"

DB database file path


This section is empty.


func CheckForMail

func CheckForMail(email string, db *sql.DB) bool

CheckForMail check if mail already exist

func CheckForUser

func CheckForUser(user string, db *sql.DB) int

CheckForUser check if already exist in the DB & returns the length of users array

func CreateTables

func CreateTables(db *sql.DB) (bool, error)

CreateTables create tables

func Delete

func Delete(uid int, category string, db *sql.DB) bool

Delete deletes credetials Replace id in the input with userid

func GetStuff

func GetStuff(uid int, category string, db *sql.DB) ([]string, []string, []string, []string)

GetStuff get user credentials from db

func GetUID

func GetUID(user string, db *sql.DB) int

GetUID get user id

func InitDb

func InitDb() *sql.DB

InitDb Open sqlite3 File

func Login

func Login(user string, passw string, db *sql.DB) bool

Login Check if username and password entred are the same as the ones on db

func Register

func Register(user string, passw string, email string, db *sql.DB) int

Register Save New username , password and email of a new user

func Save

func Save(user string, passwd string, category string, uid int, db *sql.DB) bool

Save save creds

func Update

func Update(id int, db *sql.DB, args ...string) []int

Update update credentials TODO: UPdate this Function to a nicer version note: use initialized values instead of args

func UpdatePw

func UpdatePw(password, email string, db *sql.DB) bool

UpdatePw update user's login password


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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