Documentation ¶
Index ¶
- func GetMessagesForUser(user string) []string
- func GetUserId(user string) (int, error)
- func GetUserPassHash(user string) (string, error)
- func NoUsers() bool
- func SaveMessage(message, recipient string)
- func SetUserPassHash(user, hash string) error
- func UserExists(user string) bool
- type Database
- type ErrNoUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessagesForUser ¶
GetMessagesForUser assumes that a user has already been authenticated through a call to session.Authenticate(user) and then returns all the messages stored for that user
func GetUserId ¶
GetUserId will return the UserId number for the user 'user' if that user exists and an error otherwise
func GetUserPassHash ¶
GetUserPassHash will return the string representation of a password hash if the user exists and an error otherwise
func NoUsers ¶
func NoUsers() bool
Returns true if no users have been registered and false otherwise
func SaveMessage ¶
func SaveMessage(message, recipient string)
saveMessage will process the transaction to place a message into the database
func SetUserPassHash ¶
SetUsePassHash will allow for adding a new user to the Users table
func UserExists ¶
UserExists takes a username 'user' and returns true if that user exists and false otherwise