godlremote

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package godlremote provides an adapter to access the Go download site.

Index

Constants

This section is empty.

Variables

View Source
var DownloadBase = "https://go.dev/dl/"

Functions

This section is empty.

Types

type File

type File struct {
	Filename       string `json:"filename"`
	OS             string `json:"os"`
	Arch           string `json:"arch"`
	Version        string `json:"version"`
	ChecksumSHA256 string `json:"sha256"`
	Size           int64  `json:"size"`
	Kind           string `json:"kind"` // "archive", "installer", "source"
}

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

See https://github.com/golang/build/blob/aa7fa4b2107cceba70eb6901c91e3be4b8bc419b/cmd/release/upload.go#L38-L47

func (File) Download

func (f File) Download(ctx context.Context, name string, force bool) error

Download downloads a file as name. This fail if size or checksum are not match.

func (File) Name added in v0.4.0

func (f File) Name() string

Name returns identical name.

type Release

type Release struct {
	Version string `json:"version"`
	Stable  bool   `json:"stable"`
	Files   []File `json:"files"`
}

Release represents a release. It should be kept in sync with the dl code in golang/website/internal/dl.

See https://github.com/golang/website/blob/d0b4462f2c677caac44e6f5cb06ea9fd3555f222/internal/dl/dl.go#L131-L137

func (Release) Semver added in v0.4.0

func (r Release) Semver() string

Semver returns Version in semantic versioning notation.

type Releases

type Releases []Release

Releases is a collection of Release

func Download

func Download(ctx context.Context, all bool) (Releases, error)

Download downloads releases from go.dev/dl

func (Releases) Filter

func (rels Releases) Filter(f func(Release) bool) Releases

Filter returns only matched Releases.

Jump to

Keyboard shortcuts

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