godl

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package godl serves the Go release download protocol using Athens storage.

Index

Constants

View Source
const DefaultListingTTL = 2 * time.Hour

Variables

This section is empty.

Functions

func Disabled

func Disabled() http.Handler

Types

type Handler

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

Handler adapts the Go release HTTP protocol to the release service.

func New

func New(opts Options) (*Handler, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	Storage storage.ToolchainStorage
	//nolint:containedctx // Constructor option supplies the service lifetime, not request state.
	Context      context.Context
	CacheControl string
	Upstream     *url.URL
	Source       string
	Client       *http.Client
	ListingTTL   time.Duration
	NetworkMode  string
	DownloadMode mode.Mode
	RedirectURL  *url.URL
	Workers      int
	Timeout      time.Duration
}

Options configures release storage, upstream access and miss policy. Module-path download overrides do not apply to release archives.

type Service

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

Service downloads verified releases into the configured Athens storage. It keeps upstream discovery separate from the locally available inventory.

func NewService

func NewService(opts Options) (*Service, error)

func (*Service) Archive

Archive serves committed storage hits before applying download miss policy.

func (*Service) Close

func (s *Service) Close()

Close cancels detached refreshes and background downloads.

func (*Service) Listing

func (s *Service) Listing(ctx context.Context, all bool) ([]storage.Release, time.Time, error)

Listing returns discovery metadata, or only committed local files when upstream access is disabled or fallback discovery is necessary.

Jump to

Keyboard shortcuts

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