mod

package
v0.0.0-...-1327151 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package mod provides access to Go module metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleDatabase

type ModuleDatabase interface {
	Stat(ctx context.Context, path, rev string) (*RevInfo, error)
}

func NewModuleCache

func NewModuleCache(mod ModuleDatabase, maxentries int) ModuleDatabase

NewModuleCache provides an in-memory cache in front of a ModuleDatabase.

func NewModuleProxy

func NewModuleProxy(c *http.Client, u *url.URL) ModuleDatabase

NewModuleProxy builds a module database backed by the module proxy API at the supplied base URL, using the given HTTP client for requests.

func NewOfficialModuleProxy

func NewOfficialModuleProxy(c *http.Client) ModuleDatabase

NewOfficialModuleProxy builds a module database backed by the official module proxy at https://proxy.golang.org, using the given client for requests.

type RevInfo

type RevInfo struct {
	Version string
	Time    time.Time
}

RevInfo describes a single revision to a module repository.

Jump to

Keyboard shortcuts

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