From e4122c8a2541cfda371d8768c010a87f1aef9358 Mon Sep 17 00:00:00 2001 From: Victor Conner Date: Wed, 7 Aug 2024 13:43:03 +0200 Subject: [PATCH] Move the entry struct --- entry.go | 13 ------------- shard.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 entry.go diff --git a/entry.go b/entry.go deleted file mode 100644 index 2ddea9b..0000000 --- a/entry.go +++ /dev/null @@ -1,13 +0,0 @@ -package sturdyc - -import "time" - -// entry represents a single cache entry. -type entry[T any] struct { - key string - value T - expiresAt time.Time - refreshAt time.Time - numOfRefreshRetries int - isMissingRecord bool -} diff --git a/shard.go b/shard.go index f3813bf..c39c6a5 100644 --- a/shard.go +++ b/shard.go @@ -6,6 +6,16 @@ import ( "time" ) +// entry represents a single cache entry. +type entry[T any] struct { + key string + value T + expiresAt time.Time + refreshAt time.Time + numOfRefreshRetries int + isMissingRecord bool +} + // shard is a thread-safe data structure that holds a subset of the cache entries. type shard[T any] struct { sync.RWMutex