proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPClient defines an HTTP client for executing requests.

type Proxy

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

Proxy defines a client for an upstream Go module proxy. See: https://go.dev/ref/mod#goproxy-protocol

func New

func New(client HTTPClient, upstream string) *Proxy

New creates a new Proxy for querying the supplied upstream.

func (*Proxy) GoMod

func (p *Proxy) GoMod(ctx context.Context, mod module.Version) (string, error)

GoMod executes a go.mod request and returns the h1 directory hash of the file.

func (*Proxy) Zip

func (p *Proxy) Zip(ctx context.Context, mod module.Version) (string, error)

Zip executes a request for the zip file for the specified module. It returns the h1 directory hash of the file.

Jump to

Keyboard shortcuts

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