Documentation ¶
Overview ¶
Package redis implements the storage interface for a Chihaya BitTorrent tracker keeping peer data in redis with hash. There two categories of hash:
IPv{4,6}_{L,S}_infohash To save peers that hold the infohash, used for fast searching, deleting, and timeout handling
IPv{4,6} To save all the infohashes, used for garbage collection, metrics aggregation and leecher graduation
Tree keys are used to record the count of swarms, seeders and leechers for each group (IPv4, IPv6).
IPv{4,6}_infohash_count To record the number of infohashes.
IPv{4,6}_S_count To record the number of seeders.
IPv{4,6}_L_count To record the number of leechers.
Index ¶
Constants ¶
const Name = "redis"
Name is the name by which this peer store is registered with Chihaya.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { GarbageCollectionInterval time.Duration `yaml:"gc_interval"` PrometheusReportingInterval time.Duration `yaml:"prometheus_reporting_interval"` PeerLifetime time.Duration `yaml:"peer_lifetime"` RedisBroker string `yaml:"redis_broker"` RedisReadTimeout time.Duration `yaml:"redis_read_timeout"` RedisWriteTimeout time.Duration `yaml:"redis_write_timeout"` RedisConnectTimeout time.Duration `yaml:"redis_connect_timeout"` }
Config holds the configuration of a redis PeerStore.