Skip to content

Commit

Permalink
Move the entry struct
Browse files Browse the repository at this point in the history
  • Loading branch information
creativecreature committed Aug 7, 2024
1 parent 146e7d8 commit e4122c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 0 additions & 13 deletions entry.go

This file was deleted.

10 changes: 10 additions & 0 deletions shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4122c8

Please sign in to comment.