Versions in this module Expand all Collapse all v0 v0.1.0 Nov 4, 2025 Changes in this version + const BufferSize + const CacheFileExtension + const HashLength + const NewFileExtension + func ComputeHash(value string, addIdentifiableCharacters bool) string + func RemoveInvalidFileNameChars(value string) string + func WithCacheContext(ctx context.Context, cacheCtx *SourceCacheContext) context.Context + type DiskCache struct + func NewDiskCache(rootDir string, maxSize int64) (*DiskCache, error) + func (dc *DiskCache) Clear() error + func (dc *DiskCache) Delete(sourceURL string, cacheKey string) error + func (dc *DiskCache) Get(sourceURL string, cacheKey string, maxAge time.Duration) (io.ReadCloser, bool, error) + func (dc *DiskCache) GetCachePath(sourceURL string, cacheKey string) (cacheFile string, newFile string) + func (dc *DiskCache) Set(sourceURL string, cacheKey string, data io.Reader, ...) error + type Entry struct + Expiry time.Time + Size int + Value []byte + func (e *Entry) IsExpired() bool + type MemoryCache struct + func NewMemoryCache(maxEntries int, maxSize int64) *MemoryCache + func (mc *MemoryCache) Clear() + func (mc *MemoryCache) Delete(key string) + func (mc *MemoryCache) Get(key string) ([]byte, bool) + func (mc *MemoryCache) Set(key string, value []byte, ttl time.Duration) + func (mc *MemoryCache) Stats() Stats + type MultiTierCache struct + func NewMultiTierCache(l1 *MemoryCache, l2 *DiskCache) *MultiTierCache + func (mtc *MultiTierCache) Clear() error + func (mtc *MultiTierCache) Get(ctx context.Context, sourceURL string, cacheKey string, maxAge time.Duration) ([]byte, bool, error) + func (mtc *MultiTierCache) Set(ctx context.Context, sourceURL string, cacheKey string, data io.Reader, ...) error + type SourceCacheContext struct + DirectDownload bool + MaxAge time.Duration + NoCache bool + RefreshMemoryCache bool + SessionID string + func FromContext(ctx context.Context) *SourceCacheContext + func NewSourceCacheContext() *SourceCacheContext + func (ctx *SourceCacheContext) Clone() *SourceCacheContext + type Stats struct + Entries int + SizeBytes int64