Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { Read(k K) V Write(k K, v V) V Remove(k K) Size() int }
type InMemoryCache ¶
type InMemoryCache[K comparable, V any] struct { sync.RWMutex // contains filtered or unexported fields }
func NewInMemoryCache ¶
func NewInMemoryCache[K comparable, V any]() *InMemoryCache[K, V]
func (*InMemoryCache[K, V]) FromMap ¶
func (c *InMemoryCache[K, V]) FromMap(m map[K]V) MapCache[K, V]
func (*InMemoryCache[K, V]) Read ¶
func (c *InMemoryCache[K, V]) Read(k K) V
func (*InMemoryCache[K, V]) Remove ¶
func (c *InMemoryCache[K, V]) Remove(k K)
func (*InMemoryCache[K, V]) Size ¶
func (c *InMemoryCache[K, V]) Size() int
func (*InMemoryCache[K, V]) ToMap ¶
func (c *InMemoryCache[K, V]) ToMap() map[K]V
func (*InMemoryCache[K, V]) Write ¶
func (c *InMemoryCache[K, V]) Write(k K, v V) V
type MapCache ¶
type MapCache[K comparable, V any] interface { Cache[K, V] FromMap(m map[K]V) MapCache[K, V] ToMap() map[K]V }
type NoSuchElementError ¶
type NoSuchElementError[K any] struct { // contains filtered or unexported fields }
func NewNoSuchElementError ¶
func NewNoSuchElementError[K any](key K) *NoSuchElementError[K]
func (*NoSuchElementError[K]) Error ¶
func (e *NoSuchElementError[K]) Error() string
Click to show internal directories.
Click to hide internal directories.