Documentation
¶
Overview ¶
Package proxy provides the image proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NopCache = new(nopCache)
NopCache provides a no-op cache implementation that doesn't actually cache anything.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
// Get retrieves the cached data for the provided key.
Get(key string) (data []byte, ok bool)
// Set caches the provided data.
Set(key string, data []byte)
// Delete deletes the cached data at the specified key.
Delete(key string)
}
The Cache interface defines a cache for storing arbitrary data. The interface is designed to align with httpcache.Cache.
type Proxy ¶
type Proxy struct {
Client *http.Client // client used to fetch remote URLs
Cache Cache
// Whitelist specifies a list of remote hosts that images can be proxied from. An empty list means all hosts are allowed.
Whitelist []string
MaxWidth int
MaxHeight int
}
Proxy serves image requests.
Click to show internal directories.
Click to hide internal directories.