proxy

package
v0.0.0-...-55358d4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package proxy provides support for fetching modules from a Go module proxy.

Index

Constants

View Source
const (
	// The Go toolchain module path
	StdlibModulePath = "std"

	// The Go toolchain module path
	ToolchainModulePath = "golang.org/toolchain"
)

Variables

View Source
var (
	// ErrProxyTimedOut indicates that a request to the module proxy timed out.
	ErrProxyTimedOut = errors.New("proxy timed out")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// URL of the module proxy web server.
	URL string

	// Client used for HTTP requests.
	HTTPClient *http.Client

	// MaxZipSize is the maximum zip file size allowed for reading.
	MaxZipSize int64
}

Client fetches Go modules from a module proxy.

func (*Client) Files

func (c *Client) Files(mod *internal.Module) (fs.FS, error)

Files returns the module's files.

func (*Client) Module

func (c *Client) Module(modulePath, version string) (*internal.Module, error)

Module fetches a module from the module proxy.

func (*Client) ZipSize

func (c *Client) ZipSize(ctx context.Context, modulePath, resolvedVersion string) (int64, error)

ZipSize gets the size in bytes of the zip from the proxy, without downloading it. The version must be resolved, as by a call to Client.Info.

Jump to

Keyboard shortcuts

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