forked from mirrors/pkg-proxy
- 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).
16 lines
428 B
Go
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)
|
|
}
|