cache

package
v0.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache is a thread safe LRU cache with O(1) time operations.

func New

func New(cap int) *Cache

New returns a new cache.

func (*Cache) Get

func (c *Cache) Get(id interface{}) (interface{}, bool)

Get returns a value from the cache.

func (*Cache) Invalidate added in v0.11.0

func (c *Cache) Invalidate()

Invalidate all cache entries.

func (*Cache) Put

func (c *Cache) Put(key interface{}, val interface{})

Put adds a value to the cache.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL