Remove unimplemented Purge and three unused interfaces (closes #73)
check / check (push) Waiting to run
check / check (push) Waiting to run
Purge only returned an error and nothing called it, so it is gone from the ImageCache interface and from Service, along with its error value. It can be added back when something needs it; eviction reclaims disk space meanwhile. The SignatureValidator, Allowlist and Storage interfaces in imgcache.go had no implementers and no users, and described types that look different from the real ones, so they are deleted. No behaviour changes. Model: opus-5-5
This commit was merged in pull request #175.
This commit is contained in:
@@ -56,11 +56,10 @@ type ServiceConfig struct {
|
||||
Logger *slog.Logger
|
||||
}
|
||||
|
||||
// Static errors for service construction and unimplemented operations.
|
||||
// Static errors for service construction.
|
||||
var (
|
||||
errCacheRequired = errors.New("cache is required")
|
||||
errSigningKeyRequired = errors.New("signing key is required")
|
||||
errPurgeNotImplemented = errors.New("purge not implemented")
|
||||
errCacheRequired = errors.New("cache is required")
|
||||
errSigningKeyRequired = errors.New("signing key is required")
|
||||
)
|
||||
|
||||
// NewService creates a new image service.
|
||||
@@ -189,11 +188,6 @@ func (s *Service) Warm(ctx context.Context, req *ImageRequest) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Purge removes a cached image. Purging is not implemented yet.
|
||||
func (s *Service) Purge(_ context.Context, _ *ImageRequest) error {
|
||||
return errPurgeNotImplemented
|
||||
}
|
||||
|
||||
// Stats returns cache statistics.
|
||||
func (s *Service) Stats(ctx context.Context) (*CacheStats, error) {
|
||||
return s.cache.Stats(ctx)
|
||||
|
||||
Reference in New Issue
Block a user