DataBase

package
v0.0.0-...-1124c96 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDataToDB

func AddDataToDB(roomName string, username string, data string) error

func AddTable

func AddTable(db *sql.DB, username string) int

AddTable adds a table for every user to store their data

func AddUserData

func AddUserData(userID string, loggedIn string, username string)

func AuthenticateLogin

func AuthenticateLogin(db *sql.DB, username string, password string) int

AuthenticateLogin returns 0 or 1 based on existance of account in the DB(1) or not(0)

func AuthenticateSignUp

func AuthenticateSignUp(db *sql.DB, username string, password string) int

func CheckActiveSession

func CheckActiveSession(ID string) ([]util.UserData, error)

func CheckAdmin

func CheckAdmin(user []util.UserData, roomName string) bool

func CreateRoom

func CreateRoom(room util.RoomData) error

func GetEmails

func GetEmails(username string, inbox string) *sql.Rows

GetEmails gets all the emails related to the username. inbox arg : 0 -> SentBox, 1-> Inbox

func GetRoomData

func GetRoomData(roomName string) (*sql.Rows, error)

GetRoomData gives all the emails in the room for the given roomName

func GetRoomsUser

func GetRoomsUser(username string) *sql.Rows

GetRoomsUser gives the rooms associated with the user

func GetUserData

func GetUserData(username string) *sql.Rows

GetUserData gets the users session Data from the DB

func GetUserRoomData

func GetUserRoomData(roomName string) (*sql.Rows, error)

GetUserRoomData gives the roomData associated with the roomName

func RemoveUserData

func RemoveUserData(userID string, loggedIn string, username string)

func UpdateDB

func UpdateDB(data [][]string, username string)

UpdateDB is used to handle sent and received emails from and to the users

Types

This section is empty.

Jump to

Keyboard shortcuts

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