dl

package
v0.0.0-...-ceae1e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Package dl implements a simple Go downloads frontend server.

It accepts HTTP POST requests to create a new download metadata entity, and lists entities with sorting and filtering.

The list of downloads, as well as individual files, are served at:

https://go.dev/dl/
https://go.dev/dl/{file}

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

https://go.dev/dl/?mode=json

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

https://go.dev/dl/?mode=json&include=all

Releases returned in JSON modes are sorted by version, newest to oldest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(mux *http.ServeMux, site *web.Site, host string, dc *datastore.Client, mc *memcache.Client)

Types

type Feature

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

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

type File

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 go.dev downloads page. It should be kept in sync with the upload code in x/build/internal/relui.

func (File) ChecksumType

func (f File) ChecksumType() string

func (File) Highlight

func (f File) Highlight() bool

func (File) PrettyArch

func (f File) PrettyArch() string

func (File) PrettyChecksum

func (f File) PrettyChecksum() string

func (File) PrettyKind

func (f File) PrettyKind() string

func (File) PrettyOS

func (f File) PrettyOS() string

func (File) PrettySize

func (f File) PrettySize() string

func (File) PrimaryPort

func (f File) PrimaryPort() bool

func (File) URL

func (f File) URL() string

URL returns the canonical URL of the file.

type Release

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.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL