Documentation ¶
Index ¶
- Constants
- func FillShowFromTransaction(show *Show, tx *buntdb.Tx) error
- type Database
- func (database *Database) CheckVerification(userID, code string) (bool, error)
- func (database *Database) Close() error
- func (database *Database) DeleteShow(day, hour string) error
- func (database *Database) GetCustomString(key, fallback string) (string, error)
- func (database *Database) GetRawDatabase() *buntdb.DB
- func (database *Database) GetShow(day, hour string) (Show, error)
- func (database *Database) GetShowsEmbed() (string, string, error)
- func (database *Database) InvalidateEmail(email string) (string, error)
- func (database *Database) IsEmailRegistered(email string) (bool, string, error)
- func (database *Database) PutShow(show Show) (Show, bool, error)
- func (database *Database) SetShowsEmbed(channelID, messageID string) (string, string, bool, error)
- func (database *Database) StoreVerificationCode(userID, email, code string) error
- func (database *Database) ValidateUser(userID, code string) error
- type Show
Constants ¶
const ( DayFormat = "Monday" HourFormat = "3PM" TimeFormat = DayFormat + " " + HourFormat ShowPrefix = "show:" HostSuffix = ":host" NameSuffix = ":name" ShowsEmbedChannel = "embed:shows:channel" ShowsEmbedMessage = "embed:shows:message" EmailToUser = "emails:%s:user" VerificationCodeToUser = "verification:%s:user" VerificationCodeToEmail = "verification:%s:email" Custom = "custom:%s" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) CheckVerification ¶
Checks if a verification code for a user is valid.
func (*Database) DeleteShow ¶
Deletes a show from the database.
func (*Database) GetCustomString ¶
Gets some custom string stored in the database, returning the fallback if not found.
func (*Database) GetRawDatabase ¶
func (*Database) GetShowsEmbed ¶
Gets the channel for the shows embed, if it has been set
func (*Database) InvalidateEmail ¶
Removes an email address from the database, returning the user ID of the user who held validation if it was found.
func (*Database) IsEmailRegistered ¶
Checks if an email is registered to a user, returning the user ID if it is.
func (*Database) PutShow ¶
Puts a show into the database, returning the previous show if it existed.
func (*Database) SetShowsEmbed ¶
Sets the shows embed id, returning the old id if it exists.
func (*Database) StoreVerificationCode ¶
Stores a verification code for 15 minutes.
func (*Database) ValidateUser ¶
Validates a user, storing their email in the emails database for future validation.