pkg-proxy/internal/mirror/registry.go
Andrew Nesbitt c01f0a5c05
Fix metadata caching, 404 propagation, mirror progress, and registry stubs
- ProxyCached now stores upstream Last-Modified in the cache and uses it
  (along with ETag) for conditional request handling, returning 304 when
  client validators match. Adds Content-Length to cached responses.

- Handlers calling FetchOrCacheMetadata (pypi, composer, pub, nuget) now
  check for ErrUpstreamNotFound and return 404 instead of 502, matching
  the existing npm and cargo behavior.

- Mirror jobs report live progress via a periodic callback while running,
  so API polls return real counts instead of zeroed progress.

- Registry mirroring removed from CLI flags, API acceptance, README, and
  docs since every enumerator was a stub returning "not yet implemented".

- Added tests for the conditional metadata path (ETag/If-None-Match,
  Last-Modified/If-Modified-Since, 304 responses, header omission).
2026-04-13 09:01:05 +01:00

16 lines
428 B
Go

package mirror
import (
"context"
"fmt"
)
// RegistrySource enumerates all packages in a registry for full mirroring.
// Registry enumeration is not yet implemented for any ecosystem.
type RegistrySource struct {
Ecosystem string
}
func (s *RegistrySource) Enumerate(_ context.Context, _ func(PackageVersion) error) error {
return fmt.Errorf("registry enumeration is not yet implemented for ecosystem %q", s.Ecosystem)
}