Versions in this module Expand all Collapse all v0 v0.5.1 Nov 23, 2018 Changes in this version + func DisableMirror(r *database.Redis, id int) error + func EnableMirror(r *database.Redis, id int) error + func MarkMirrorDown(r *database.Redis, id int, reason string) error + func MarkMirrorUp(r *database.Redis, id int) error + func SetMirrorEnabled(r *database.Redis, id int, state bool) error + func SetMirrorState(r *database.Redis, id int, state bool, reason string) error + type ByComputedScore struct + func (b ByComputedScore) Less(i, j int) bool + type ByExcludeReason struct + func (b ByExcludeReason) Less(i, j int) bool + type ByRank struct + ClientInfo network.GeoIPRecord + func (m ByRank) Less(i, j int) bool + type Cache struct + func NewCache(r *database.Redis) *Cache + func (c *Cache) Clear() + func (c *Cache) GetFileInfo(path string) (f filesystem.FileInfo, err error) + func (c *Cache) GetMirror(id int) (mirror Mirror, err error) + func (c *Cache) GetMirrorInvalidationEvent() <-chan string + func (c *Cache) GetMirrors(path string, clientInfo network.GeoIPRecord) (mirrors []Mirror, err error) + type Item struct + Key string + Value Value + type LRUCache struct + func NewLRUCache(capacity uint64) *LRUCache + func (lru *LRUCache) Clear() + func (lru *LRUCache) Delete(key string) bool + func (lru *LRUCache) Get(key string) (v Value, ok bool) + func (lru *LRUCache) Items() []Item + func (lru *LRUCache) Keys() []string + func (lru *LRUCache) Set(key string, value Value) + func (lru *LRUCache) SetCapacity(capacity uint64) + func (lru *LRUCache) SetIfAbsent(key string, value Value) + func (lru *LRUCache) Stats() (length, size, capacity uint64, oldest time.Time) + func (lru *LRUCache) StatsJSON() string + type Mirror struct + ASOnly bool + AdminEmail string + AdminName string + AllowRedirects Redirects + Asnum uint + Comment string + ComputedScore int + ContinentCode string + ContinentOnly bool + CountryCodes string + CountryFields []string + CountryOnly bool + CustomData string + Distance float32 + Enabled bool + ExcludeReason string + ExcludedCountryCodes string + ExcludedCountryFields []string + FileInfo *filesystem.FileInfo + Filepath string + FtpURL string + HttpURL string + ID int + LastModTime Time + LastSuccessfulSync Time + LastSync Time + Latitude float32 + Longitude float32 + Name string + RsyncURL string + Score int + SponsorLogoURL string + SponsorName string + SponsorURL string + StateSince Time + Up bool + Weight float32 + func (m *Mirror) IsHTTPS() bool + func (m *Mirror) Prepare() + type Mirrors []Mirror + func (s Mirrors) Len() int + func (s Mirrors) Swap(i, j int) + type Redirects int + func (r *Redirects) Allowed() bool + func (r *Redirects) UnmarshalYAML(unmarshal func(interface{}) error) error + func (r Redirects) MarshalYAML() (interface{}, error) + type Results struct + ClientInfo network.GeoIPRecord + ExcludedList Mirrors + Fallback bool + FileInfo filesystem.FileInfo + IP string + LocalJSPath string + MirrorList Mirrors + type Time struct + func (t *Time) RedisScan(src interface{}) (err error) + func (t Time) FromTime(time time.Time) Time + func (t Time) RedisArg() interface{} + type Value interface + Size func() int