mod

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 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

func IsMetaPackage

func IsMetaPackage(name string) bool

IsMetaPackage checks if name is a reserved package name that expands to multiple packages.

func Parse

func Parse(s string) module.Version

Parse module string into path and version.

Types

type Infoer

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

func NewInfoCache

func NewInfoCache(i Infoer, maxentries int) Infoer

NewInfoCache provides an in-memory cache in front of an Infoer.

type ModuleDatabase

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

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