diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go')
| -rw-r--r-- | vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go b/vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go deleted file mode 100644 index ce8aeb63b..000000000 --- a/vendor/codeberg.org/gruf/go-storage/s3/cache/cache.go +++ /dev/null @@ -1,44 +0,0 @@ -package cache - -import ( - "time" - - "codeberg.org/gruf/go-cache/v3/simple" - "codeberg.org/gruf/go-cache/v3/ttl" - "codeberg.org/gruf/go-storage/s3" -) - -// check interface conformity. -var _ s3.EntryCache = &EntryCache{} -var _ s3.EntryCache = &EntryTTLCache{} - -// EntryCache provides a basic implementation -// of an s3.EntryCache{}. Under the hood it is -// a mutex locked ordered map with max capacity. -type EntryCache struct { - simple.Cache[string, *s3.CachedObjectInfo] -} - -func New(len, cap int) *EntryCache { - var cache EntryCache - cache.Init(len, cap) - return &cache -} - -func (c *EntryCache) Put(key string, info *s3.CachedObjectInfo) { - c.Cache.Set(key, info) -} - -type EntryTTLCache struct { - ttl.Cache[string, *s3.CachedObjectInfo] -} - -func NewTTL(len, cap int, ttl time.Duration) *EntryTTLCache { - var cache EntryTTLCache - cache.Init(len, cap, ttl) - return &cache -} - -func (c *EntryTTLCache) Put(key string, info *s3.CachedObjectInfo) { - c.Cache.Set(key, info) -} |
