Add package and const block comments to imgcache

This commit is contained in:
2026-01-08 02:29:25 -08:00
parent 453fd22ce2
commit 827f9743b8

View File

@@ -1,3 +1,4 @@
// Package imgcache provides interfaces and types for the image caching proxy.
package imgcache
import (
@@ -7,9 +8,10 @@ import (
"time"
)
// ImageFormat represents supported output image formats
// ImageFormat represents supported output image formats.
type ImageFormat string
// Supported image output formats.
const (
FormatOriginal ImageFormat = "orig"
FormatJPEG ImageFormat = "jpeg"
@@ -30,9 +32,10 @@ func (s Size) OriginalSize() bool {
return s.Width == 0 && s.Height == 0
}
// FitMode represents how to fit image into requested dimensions
// FitMode represents how to fit image into requested dimensions.
type FitMode string
// Supported image fit modes.
const (
FitCover FitMode = "cover"
FitContain FitMode = "contain"
@@ -89,9 +92,10 @@ type ImageResponse struct {
CacheStatus CacheStatus
}
// CacheStatus indicates whether the response was served from cache
// CacheStatus indicates whether the response was served from cache.
type CacheStatus string
// Cache status values for response headers.
const (
CacheHit CacheStatus = "HIT"
CacheMiss CacheStatus = "MISS"