Documentation
¶
Index ¶
- Constants
- type Encryptor
- type Redemption
- type Sqlite
- func (s *Sqlite) AddCode(code, game string, userID *string, source *string) error
- func (s *Sqlite) AddRedemption(userID, code, platform string, status string) error
- func (s *Sqlite) AddShiftError(userID, code, platform, error string) error
- func (s *Sqlite) AddUser(userID string) error
- func (s *Sqlite) ClearShiftErrors(userID string) error
- func (s *Sqlite) Close() error
- func (s *Sqlite) CodeExists(code string) bool
- func (s *Sqlite) DeleteUserCookies(userID string) error
- func (s *Sqlite) EncryptAndSetUserCookies(userID string, cookies []*http.Cookie) error
- func (s *Sqlite) GetAllDecryptedUserCookiesSorted(limit int64) ([]UserCookies, error)
- func (s *Sqlite) GetDecryptedUserCookies(userID string) ([]*http.Cookie, error)
- func (s *Sqlite) GetRecentRedemptionsForUser(userID string, status string, quantity int) ([]Redemption, error)
- func (s *Sqlite) GetShiftErrors(userID string) ([]string, error)
- func (s *Sqlite) GetStatistics(userID string) (Statistics, error)
- func (s *Sqlite) GetUserPlatformAndDM(userID string) (string, bool, error)
- func (s *Sqlite) GetValidCodesNotRedeemedForUser(userID, platform string, limit int) ([]string, error)
- func (s *Sqlite) RedemptionSummaryForUser(userID string) (map[string]int64, error)
- func (s *Sqlite) SetCodeRewardAndSuccess(code, reward string, success bool) (bool, error)
- func (s *Sqlite) SetUserDM(userID string, dm bool) error
- func (s *Sqlite) SetUserPlatform(userID, platform string) error
- func (s *Sqlite) UserCookiesExists(userID string) bool
- func (s *Sqlite) UserExists(userID string) bool
- type Statistics
- type Store
- type UserCookies
Constants ¶
View Source
const DiscordSource = "discord"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
func NewEncryptor ¶
NewEncryptor takes a 32-byte key (AES-256)
type Redemption ¶
type Sqlite ¶
type Sqlite struct {
// contains filtered or unexported fields
}
func (*Sqlite) AddRedemption ¶
func (*Sqlite) AddShiftError ¶
func (*Sqlite) ClearShiftErrors ¶
func (*Sqlite) CodeExists ¶
func (*Sqlite) DeleteUserCookies ¶
func (*Sqlite) EncryptAndSetUserCookies ¶
func (*Sqlite) GetAllDecryptedUserCookiesSorted ¶
func (s *Sqlite) GetAllDecryptedUserCookiesSorted(limit int64) ([]UserCookies, error)
func (*Sqlite) GetDecryptedUserCookies ¶
func (*Sqlite) GetRecentRedemptionsForUser ¶
func (*Sqlite) GetStatistics ¶
func (s *Sqlite) GetStatistics(userID string) (Statistics, error)
func (*Sqlite) GetUserPlatformAndDM ¶
func (*Sqlite) GetValidCodesNotRedeemedForUser ¶
func (*Sqlite) RedemptionSummaryForUser ¶
func (*Sqlite) SetCodeRewardAndSuccess ¶
func (*Sqlite) SetUserPlatform ¶
func (*Sqlite) UserCookiesExists ¶
func (*Sqlite) UserExists ¶
type Statistics ¶
type Store ¶
type Store interface {
UserExists(userID string) bool
AddUser(userID string) error
GetUserPlatformAndDM(userID string) (string, bool, error)
SetUserPlatform(userID, platform string) error
SetUserDM(userID string, dm bool) error
UserCookiesExists(userID string) bool
EncryptAndSetUserCookies(userID string, cookie []*http.Cookie) error
GetDecryptedUserCookies(userID string) ([]*http.Cookie, error)
DeleteUserCookies(userID string) error
GetAllDecryptedUserCookiesSorted(limit int64) ([]UserCookies, error)
CodeExists(code string) bool
AddCode(code, game string, userID *string, source *string) error
SetCodeRewardAndSuccess(code, reward string, success bool) (bool, error)
GetValidCodesNotRedeemedForUser(userID, platform string, limit int) ([]string, error)
GetRecentRedemptionsForUser(userID, status string, quantity int) ([]Redemption, error)
RedemptionSummaryForUser(userID string) (map[string]int64, error)
AddRedemption(userID, code, platform string, status string) error
AddShiftError(userID, code, platform, error string) error
GetShiftErrors(userID string) ([]string, error)
ClearShiftErrors(userID string) error
GetStatistics(userID string) (Statistics, error)
Close() error
}
type UserCookies ¶
Click to show internal directories.
Click to hide internal directories.