Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <[email protected]>
  • Loading branch information
cody-littley committed Nov 27, 2024
1 parent e925517 commit a9d3329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions relay/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package cache
// WeightCalculator is a function that calculates the weight of a key-value pair in a Cache.
// By default, the weight of a key-value pair is 1. Cache capacity is always specified in terms of
// the weight of the key-value pairs it can hold, rather than the number of key-value pairs.
//
// Unless otherwise noted, Cache implementations are not required to be thread safe.
type WeightCalculator[K comparable, V any] func(key K, value V) uint64

// Cache is an interface for a generic cache.
//
// Unless otherwise noted, Cache implementations are not required to be thread safe.
type Cache[K comparable, V any] interface {
// Get returns the value associated with the key, and a boolean indicating whether the key was found in the cache.
Get(key K) (V, bool)
Expand Down

0 comments on commit a9d3329

Please sign in to comment.