ttllru

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	TimeToLive time.Duration
	// contains filtered or unexported fields
}

Cache is a TTL LRU cache which caches items with a max time to live and with bounded length

func New

func New(size int, timeToLive time.Duration) (*Cache, error)

New creates a new TTL LRU cache which caches items with a max time to live and with bounded length

func (*Cache) Add

func (ttlCache *Cache) Add(key interface{}, val interface{})

Add will add a value for a given key

func (*Cache) Get

func (ttlCache *Cache) Get(key interface{}) (value interface{}, ok bool)

Get returns a value and a bool indicating the value was found for a given key

Directories

Path Synopsis
Package mock_ttllru is a generated GoMock package.
Package mock_ttllru is a generated GoMock package.

Jump to

Keyboard shortcuts

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