modfetch

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package modfetch reads the modules a site release bundles at publish (#2774): by URL, through the egress guard, kept in the replica's memory by URL. It is the network half of a site build; internal/site/sitebuild reads the tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFetcher

type HTTPFetcher struct {
	// contains filtered or unexported fields
}

HTTPFetcher reads modules by URL through a client the caller builds (with the egress guard under it), keeping what it read by URL: a URL a release may import names an exact version, so what it serves does not change.

func NewGuardedFetcher

func NewGuardedFetcher() (*HTTPFetcher, error)

NewGuardedFetcher is the fetcher a deployment publishes with: a client whose every dial passes the egress guard, so a URL a release names cannot reach a private, loopback, link-local or metadata address, and which follows no redirect.

func NewHTTPFetcher

func NewHTTPFetcher(client *http.Client) *HTTPFetcher

NewHTTPFetcher is a fetcher over client.

func (*HTTPFetcher) Fetch

func (f *HTTPFetcher) Fetch(ctx context.Context, u string) (body []byte, contentType string, err error)

Fetch reads one module, from the cache when it holds it.

Jump to

Keyboard shortcuts

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