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 package imgcache
import ( import (
@@ -7,9 +8,10 @@ import (
"time" "time"
) )
// ImageFormat represents supported output image formats // ImageFormat represents supported output image formats.
type ImageFormat string type ImageFormat string
// Supported image output formats.
const ( const (
FormatOriginal ImageFormat = "orig" FormatOriginal ImageFormat = "orig"
FormatJPEG ImageFormat = "jpeg" FormatJPEG ImageFormat = "jpeg"
@@ -30,9 +32,10 @@ func (s Size) OriginalSize() bool {
return s.Width == 0 && s.Height == 0 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 type FitMode string
// Supported image fit modes.
const ( const (
FitCover FitMode = "cover" FitCover FitMode = "cover"
FitContain FitMode = "contain" FitContain FitMode = "contain"
@@ -89,9 +92,10 @@ type ImageResponse struct {
CacheStatus CacheStatus CacheStatus CacheStatus
} }
// CacheStatus indicates whether the response was served from cache // CacheStatus indicates whether the response was served from cache.
type CacheStatus string type CacheStatus string
// Cache status values for response headers.
const ( const (
CacheHit CacheStatus = "HIT" CacheHit CacheStatus = "HIT"
CacheMiss CacheStatus = "MISS" CacheMiss CacheStatus = "MISS"