goproxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package goproxy implements proxies.CacheProxy for Go modules.

It implements the Go module proxy protocol (GOPROXY spec) and caches immutable responses (.info, .mod, .zip) on disk. Mutable endpoints (list, @latest) are passed through to the upstream proxy without caching.

ephemerd runs one shared instance on the bridge gateway IP so all job containers can reach it. Containers see it as GOPROXY=http://<gateway>:<port>. Jobs have no write access to the cache — they just make HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CacheDir   string // on-disk cache directory
	Upstream   string // upstream proxy URL (default: https://proxy.golang.org)
	ListenAddr string // address to listen on (e.g., "10.88.0.1:8082")
	Cleanup    bool   // wipe cache dir on Stop
	Log        *slog.Logger
}

Config for the Go module caching proxy.

type Proxy

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

Proxy is a caching Go module proxy server.

func New

func New(cfg Config) *Proxy

New creates a Go module caching proxy. Call Start() to begin serving.

func (*Proxy) Addr

func (p *Proxy) Addr() string

Addr returns the address the proxy is listening on.

func (*Proxy) EnvVars

func (p *Proxy) EnvVars() []string

EnvVars returns the environment variables to inject into job containers.

func (*Proxy) Name

func (p *Proxy) Name() string

Name returns the proxy name for logging.

func (*Proxy) Start

func (p *Proxy) Start() error

Start begins serving the proxy. Returns after the listener is bound.

func (*Proxy) Stop

func (p *Proxy) Stop() error

Stop shuts down the proxy and optionally wipes the cache.

Jump to

Keyboard shortcuts

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