Versions in this module Expand all Collapse all v0 v0.5.1 Nov 23, 2018 Changes in this version + const CHECKSUM + const FILESTATS + const MIRRORLIST + const MIRRORSTATS + const STANDARD + const UNDEFINED + const WITHOUTTLS + const WITHTLS + var ErrTemplatesNotFound = errors.New("please set a valid path to the templates directory") + func NewGzipHandler(fn http.HandlerFunc) http.HandlerFunc + type Context struct + func NewContext(w http.ResponseWriter, r *http.Request, t Templates) *Context + func (c *Context) IsChecksum() bool + func (c *Context) IsFileStats() bool + func (c *Context) IsMirrorStats() bool + func (c *Context) IsMirrorlist() bool + func (c *Context) IsPretty() bool + func (c *Context) QueryParam(key string) string + func (c *Context) Request() *http.Request + func (c *Context) ResponseWriter() http.ResponseWriter + func (c *Context) SecureOption() SecureOption + func (c *Context) Templates() Templates + func (c *Context) Type() RequestType + type DefaultEngine struct + func (h DefaultEngine) Selection(ctx *Context, cache *mirrors.Cache, fileInfo *filesystem.FileInfo, ...) (mlist mirrors.Mirrors, excluded mirrors.Mirrors, err error) + type HTTP struct + Listener *net.Listener + Restarting bool + func HTTPServer(redis *database.Redis, cache *mirrors.Cache) *HTTP + func (h *HTTP) LoadTemplates(name string) (t *template.Template, err error) + func (h *HTTP) Reload() + func (h *HTTP) RunServer() (err error) + func (h *HTTP) SetListener(l net.Listener) + func (h *HTTP) Stop(timeout time.Duration) + func (h *HTTP) StopChan() <-chan struct{} + func (h *HTTP) Terminate() + type JSONRenderer struct + func (w *JSONRenderer) Type() string + func (w *JSONRenderer) Write(ctx *Context, results *mirrors.Results) (statusCode int, err error) + type MirrorListRenderer struct + func (w *MirrorListRenderer) Type() string + func (w *MirrorListRenderer) Write(ctx *Context, results *mirrors.Results) (statusCode int, err error) + type MirrorStats struct + Bytes int64 + Downloads int64 + ID int + Name string + PercentB float32 + PercentD float32 + SyncOffset SyncOffset + type MirrorStatsPage struct + List []MirrorStats + LocalJSPath string + MirrorList []mirrors.Mirror + type RedirectRenderer struct + func (w *RedirectRenderer) Type() string + func (w *RedirectRenderer) Write(ctx *Context, results *mirrors.Results) (statusCode int, err error) + type RequestType int + type SecureOption int + type Stats struct + func NewStats(redis *database.Redis) *Stats + func (s *Stats) CountDownload(m mirrors.Mirror, fileinfo filesystem.FileInfo) error + func (s *Stats) Terminate() + type StatsFileNow struct + Month int64 + Today int64 + Total int64 + Year int64 + type StatsFilePeriod struct + Downloads int64 + Period string + type SyncOffset struct + HumanReadable string + Valid bool + Value int + type Templates struct