Documentation ¶
Index ¶
- Variables
- func CreateNewTorrentKey(c *redis.Client, key string)
- func GetAllPeers(c *redis.Client, key string) []string
- func GetBoolKeyVal(c *redis.Client, key string) bool
- func GetCount(c *redis.Client, infoHash string, member string) (retval int, err error)
- func GetKeyVal(c *redis.Client, key string) []string
- func OpenClient() (client *redis.Client)
- func RemoveKeysValue(c *redis.Client, key string, value string)
- func SetIPMember(c *redis.Client, infoHash, ipPort string) (retval int)
- func SetKeyIfNotExists(c *redis.Client, keymember string, value string) (rv bool)
- func SetKeyVal(c *redis.Client, keymember string, value string)
Constants ¶
This section is empty.
Variables ¶
View Source
var EXPIRETIME int64 = 5 * 60
EXPIRETIME signifies how long a peer will live under the specified info_hash until the reaper removes it.
Functions ¶
func CreateNewTorrentKey ¶
func CreateNewTorrentKey(c *redis.Client, key string)
CreateNewTorrentKey Creates a new key. By default, it adds a member ":ip". I don't think this ought to ever be generalized, as I just want
to function in one specific way in notorious.
func GetAllPeers ¶
GetAllPeers fetches all peers from the info_hash at `key`
func GetBoolKeyVal ¶
GetBoolKeyVal Checks if a `key` exists
func RemoveKeysValue ¶
RemoveKeysValue Remove a `value` from `key` in the redis kv storage. `key` is typically a keymember of info_hash:(in)complete and the value is typically the ip:port concatenated.
func SetIPMember ¶
SetIPMember sets a key as a member of an infohash and sets a timeout.
func SetKeyIfNotExists ¶
SetKeyIfNotExists Set a key if it doesn't exist.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.