website: Index | Files

package dl

import ""

Package dl implements a simple downloads frontend server.

It accepts HTTP POST requests to create a new download metadata entity, and lists entities with sorting and filtering. It is designed to run only on the instance of godoc that serves

The package also serves the list of downloads and individual files at:{file}

An optional query param, mode=json, serves the list of stable release downloads in JSON format:

An additional query param, include=all, when used with the mode=json query param, will serve a full list of available downloads, including stable, unstable, and archived releases in JSON format:


Package Files

dl.go server.go tmpl.go

func RegisterHandlers Uses

func RegisterHandlers(mux *http.ServeMux, dc *datastore.Client, mc *memcache.Client)

type Feature Uses

type Feature struct {
    // The File field will be filled in by the first stable File
    // whose name matches the given fileRE.

    Platform     string // "Microsoft Windows", "Apple macOS", "Linux"
    Requirements string // "Windows XP and above, 64-bit Intel Processor"
    // contains filtered or unexported fields

type File Uses

type File struct {
    Filename       string    `json:"filename"`
    OS             string    `json:"os"`
    Arch           string    `json:"arch"`
    Version        string    `json:"version"`
    Checksum       string    `json:"-" datastore:",noindex"` // SHA1; deprecated
    ChecksumSHA256 string    `json:"sha256" datastore:",noindex"`
    Size           int64     `json:"size" datastore:",noindex"`
    Kind           string    `json:"kind"` // "archive", "installer", "source"
    Uploaded       time.Time `json:"-"`

File represents a file on the downloads page. It should be kept in sync with the upload code in x/build/cmd/release.

func (File) ChecksumType Uses

func (f File) ChecksumType() string

func (File) Highlight Uses

func (f File) Highlight() bool

func (File) PrettyChecksum Uses

func (f File) PrettyChecksum() string

func (File) PrettyOS Uses

func (f File) PrettyOS() string

func (File) PrettySize Uses

func (f File) PrettySize() string

func (File) PrimaryPort Uses

func (f File) PrimaryPort() bool

func (File) URL Uses

func (f File) URL() string

URL returns the canonical URL of the file.

type Release Uses

type Release struct {
    Version        string `json:"version"`
    Stable         bool   `json:"stable"`
    Files          []File `json:"files"`
    Visible        bool   `json:"-"` // show files on page load
    SplitPortTable bool   `json:"-"` // whether files should be split by primary/other ports.

Package dl imports 19 packages (graph). Updated 2021-01-22. Refresh now. Tools for package owners.