MCPcopy
hub / github.com/filebrowser/filebrowser / UploadCache

Interface UploadCache

http/upload_cache_memory.go:17–32  ·  view source on GitHub ↗

UploadCache is an interface for tracking active uploads. Allows for different backends (e.g. in-memory or redis) to support both single instance and multi replica deployments.

Source from the content-addressed store, hash-verified

15// Allows for different backends (e.g. in-memory or redis)
16// to support both single instance and multi replica deployments.
17type UploadCache interface {
18 // Register stores an upload with its expected file size
19 Register(filePath string, fileSize int64)
20
21 // Complete removes an upload from the cache
22 Complete(filePath string)
23
24 // GetLength returns the expected file size for an active upload
25 GetLength(filePath string) (int64, error)
26
27 // Touch refreshes the TTL for an active upload
28 Touch(filePath string)
29
30 // Close cleans up any resources
31 Close()
32}
33
34// memoryUploadCache is an upload cache for single replica deployments
35type memoryUploadCache struct {

Callers 16

tusPostHandlerFunction · 0.65
tusPatchHandlerFunction · 0.65
tusDeleteHandlerFunction · 0.65
tusHeadHandlerFunction · 0.65
tusPatchHandlerFunction · 0.65
tusDeleteHandlerFunction · 0.65
TouchMethod · 0.65
keepUploadActiveFunction · 0.65
TestScopedFsFunction · 0.65
ChecksumMethod · 0.65
calculateImageResolutionFunction · 0.65
readFirstBytesMethod · 0.65

Implementers 2

memoryUploadCachehttp/upload_cache_memory.go
redisUploadCachehttp/upload_cache_redis.go

Calls

no outgoing calls

Tested by

no test coverage detected