Documentation ¶
Index ¶
- Variables
- func AddUserSession(userID int, sessionID string) error
- func AddUserStore(userID, storeID int) error
- func Delete(key string) error
- func DeleteAPIKeySecretKey(apiKey string) error
- func DeleteAPIKeyStore(apiKey string) error
- func DeleteSession(sessionID string) error
- func DeleteStoreTitle(storeID int) error
- func DeleteUserSessions(userID int) error
- func Exists(key string) (exists bool, err error)
- func Expire(key string, ttl int) error
- func FlushAll() error
- func GetAPIKeySecretKey(apiKey string) (secretKey string, err error)
- func GetAPIKeyStore(apiKey string) (storeID int, err error)
- func GetInt(key string) (value int, err error)
- func GetSessionUser(sessionID string) (userID int, err error)
- func GetSetMembers(key string) (members []string, err error)
- func GetStoreTitle(storeID int) (title string, err error)
- func GetString(key string) (value string, err error)
- func GetUserEmail(userID int) (email string, err error)
- func GetUserSessions(userID int) (sessionIDs []string, err error)
- func GetUserStores(userID int) (storeIDs []int, err error)
- func GetUserUsername(userID int) (username string, err error)
- func IsSetMember(key string, member interface{}) (bool, error)
- func IsSupportedCurrency(currency string) (bool, error)
- func NewPool(address string) *redis.Pool
- func Ping() error
- func RemoveUserSession(userID int, sessionID string) error
- func RemoveUserStore(userID, storeID int) error
- func Set(key string, value interface{}) error
- func SetAPIKeySecretKey(apiKey, secretKey string) error
- func SetAPIKeyStore(apiKey string, storeID int) error
- func SetAddMember(key string, member interface{}) error
- func SetRemoveMember(key string, member interface{}) error
- func SetSessionExpiration(sessionID string, ttl int) error
- func SetSessionUser(sessionID string, userID int) error
- func SetStoreTitle(storeID int, title string) error
- func SetSupportedCurrencies(currencies []string) error
- func SetUserEmail(userID int, email string) error
- func SetUserUsername(userID int, username string) error
- func UserOwnsStore(userID, storeID int) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var Pool *redis.Pool
Pool is the gloabl pool of Redis connections opened in main
Functions ¶
func AddUserSession ¶
AddUserSession adds userID to userid:<userID>:sessionids set
func AddUserStore ¶
AddUserStore adds storeID to userid:<userID>:storeids set
func DeleteAPIKeySecretKey ¶
DeleteAPIKeySecretKey deletes key apikey:<apiKey>:secretkey
func DeleteAPIKeyStore ¶
DeleteAPIKeyStore deletes key apikey:<apiKey>:storeid
func DeleteSession ¶
DeleteSession deletes key sessionid:<sessionID>:userid
func DeleteStoreTitle ¶
DeleteStoreTitle deletes storeid:<storeid>:title key
func DeleteUserSessions ¶
DeleteUserSessions removes set userid:<userID>:sessionids
func GetAPIKeySecretKey ¶
GetAPIKeySecretKey returns the string value of apikey:<apiKey>:secretkey
func GetAPIKeyStore ¶
GetAPIKeyStore returns the int value of apikey:<apiKey>:storeid
func GetSessionUser ¶
GetSessionUser returns the int value of key sessionid:<sessionID>:userid
func GetSetMembers ¶
GetSetMembers gets the members of a set from a Redis DB
func GetStoreTitle ¶
GetStoreTitle returns the string value of key storeid:<storeID>:title
func GetUserEmail ¶
GetUserEmail returns the string value of key userid:<userID>:email
func GetUserSessions ¶
GetUserSessions returns all the values of set userid:<userID>:sessionids
func GetUserStores ¶
GetUserStores returns all the values of set userid:<userID>:storeids
func GetUserUsername ¶
GetUserUsername returns the string value of key userid:<userID>:username
func IsSetMember ¶
IsSetMember returns whether "member" is a member of the set "key" or not
func IsSupportedCurrency ¶
IsSupportedCurrency returns whether currency is a member of the supportedcurrencies set or not
func RemoveUserSession ¶
RemoveUserSession removes sessionID from userid:<userID>:sessionids set
func RemoveUserStore ¶
RemoveUserStore removes storeID from userid:<userID>:storeids set
func SetAPIKeySecretKey ¶
SetAPIKeySecretKey sets secretKey as the value of apikey:<apiKey>:secretkey
func SetAPIKeyStore ¶
SetAPIKeyStore sets storeID as the value of apikey:<apiKey>:storeid
func SetAddMember ¶
SetAddMember adds a member to a set in a Redis DB
func SetRemoveMember ¶
SetRemoveMember removes the member of a set from a Redis DB
func SetSessionExpiration ¶
SetSessionExpiration sets key sessionid:<sessionID>:userid to expire after ttl seconds passed
func SetSessionUser ¶
SetSessionUser sets userID as the value of sessionid:<sessionID>:userid key
func SetStoreTitle ¶
SetStoreTitle sets title as the value of storeid:<storeID>:title key
func SetSupportedCurrencies ¶
SetSupportedCurrencies adds all currencies to the supportedcurrencies set
func SetUserEmail ¶
SetUserEmail sets email as the value of key userid:<userID>:email
func SetUserUsername ¶
SetUserUsername sets username as the value of key userid:<userID>:username
func UserOwnsStore ¶
UserOwnsStore returns whether storeID is a member of userid:<userID>:storeids set or not
Types ¶
This section is empty.