Documentation
¶
Overview ¶
Package imagecache provides utilities for downloading and caching remote images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCacheDir ¶
DefaultCacheDir returns the default cache directory path.
func DownloadAndCache ¶
DownloadAndCache downloads a remote image and saves it to the cache directory. Returns the local file path where the image was saved.
Types ¶
type CacheOptions ¶
type CacheOptions struct {
// CacheDir is the directory where images will be cached.
// If empty, defaults to ~/.cache/tinct/images
CacheDir string
// Filename is the filename to use for the cached image.
// If empty, uses a hash of the URL + original extension.
Filename string
// AllowOverwrite determines if existing cached files can be overwritten.
// Default: false (reuse existing cached files).
AllowOverwrite bool
}
CacheOptions configures image caching behavior.
Click to show internal directories.
Click to hide internal directories.