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 ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler adapts the Go release HTTP protocol to the release service.
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 (*Service) Archive ¶
func (s *Service) Archive(ctx context.Context, name string) (storage.ArchiveInfo, storage.SizeReadCloser, error)
Archive serves committed storage hits before applying download miss policy.
Click to show internal directories.
Click to hide internal directories.