Documentation
¶
Index ¶
- func AddFriend(friendCode string, id int) error
- func AreMutualFriends(user_one_id int, user_two_id int) bool
- func CreateAccount(username string, password string) error
- func DeactivateSession(id int) error
- func DeleteAccount(id int) error
- func DeleteFriend(id int, username string) error
- func DeleteTransaction(id int, filename string) error
- func GetConn() (*pgx.Conn, error)
- func GetCurrentId() int
- func GetUserFriendCode(id int) (string, error)
- func GetUserID(name string) (int, error)
- func GetUserNameByID(id int) (string, error)
- func HashInfo(text string) string
- func InitializeDatabase() error
- func InsertPublicKey(id int, key []byte) error
- func InsertRSA(nonce []byte, key []byte, id int) error
- func IsFriend(user_one_id int, user_two_id int) bool
- func Login(username string, password string) error
- func PerformTransaction(from_user_id int, user_to string, filename string) (int, error)
- func RetrievePublicKey(id int) ([]byte, error)
- func RetrieveRSA(user int, file string) ([]byte, []byte, error)
- func SetActiveSession() (int, error)
- func UserCanViewTransaction(id int, filename string) bool
- type Friend
- type Sql
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreMutualFriends ¶
AreMutualFriends determines if two users are mutual friends
func CreateAccount ¶
Creates an account in the database uuid is unique to the computer, and is used on startup to indentify the device
func DeactivateSession ¶
Deactivates the session of a single user
func DeleteAccount ¶
Removes all account information for a given user and deletes all rows that they are present in, including sent
func DeleteFriend ¶
Removes a friend from users friend list
func DeleteTransaction ¶
Deletes a transaction record based on the given id
func GetUserFriendCode ¶
Retrieves a user's freind code based on their name, which is passed in
func GetUserNameByID ¶
Retrieves a user's name based on their id, which is passed in
func InsertPublicKey ¶
Inserts the public key into the userkey table
func PerformTransaction ¶
Enters the information of a transaction to the database for later referal
func RetrievePublicKey ¶
Retrieves the key from the database that is used to encrypt the file
func RetrieveRSA ¶
Returns the RSA encrypted nonce and key
func SetActiveSession ¶
Returns the current users id and sets the session
func UserCanViewTransaction ¶
Checks if a user has the right to view a transaction
Types ¶
type Friend ¶
func GetFriendsList ¶
Retrieves a list of friends for a given user
type Transaction ¶
func GetPendingTransfers ¶
func GetPendingTransfers(id int) ([]Transaction, error)
retrieves pending file transfer requests for a certain user