db

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

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCicerone

func AddCicerone(uid, tel int, iban, fcode string) error

func Close

func Close()

Close function closes this database connection

func CreateEvent

func CreateEvent(e types.Evento) error

func CreateUser

func CreateUser(u types.User) (e error)

CreateUser will create a new user. It takes as input a generic user type and optionally the UserId

func DeleteEventById

func DeleteEventById(id int) (e error)

func DeleteEveryEvent

func DeleteEveryEvent() error

func DeleteSelectedUser

func DeleteSelectedUser(email, password string) (e error)

func DeleteUserById

func DeleteUserById(uid int) (e error)

func GetEventById

func GetEventById(id int) (Evento types.Evento, e error)

func GetEvents

func GetEvents() (E []types.MiniEvento, e error)

func GetUserEmail

func GetUserEmail(uid int) (email string)

func GetUserID

func GetUserID(email string) (userID int)

GetUserID will get the user's ID from the database

func GetUserInfo

func GetUserInfo(email string) (u types.User, e error)

func InvertUserId

func InvertUserId(uid int) (e error)

func IsCicerone

func IsCicerone(uid int) (false bool)

func SearchEvent

func SearchEvent(query string) (E []types.MiniEvento, e error)

TODO: improve search query in order to filter the results

func ValidUser

func ValidUser(email, password string) bool

ValidUser will check if the user exists in db and if exists if the username password combination is valid

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database encapsulates database

Jump to

Keyboard shortcuts

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