sqlite

package
v0.0.0-...-17ddb13 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

DB database file path

Variables

This section is empty.

Functions

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 CountUsers

func CountUsers(db *sql.DB) (int, error)

CountUsers Count the number of user that we have in the Database

func CreateTables

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

CreateTables create tables

func Delete

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

Delete deletes credetials by providing password id or category

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) (bool, bool, bool)

Update update credentials

func UpdatePw

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

UpdatePw update user's login password

Types

This section is empty.

Jump to

Keyboard shortcuts

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