ccache

package
v0.0.0-...-43c3cf5 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCache

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

concurrent safe lru cache

func NewCCache

func NewCCache(maxEntries int) *CCache

func (*CCache) Add

func (c *CCache) Add(key lru.Key, value interface{})

func (*CCache) Clear

func (c *CCache) Clear()

func (*CCache) Get

func (c *CCache) Get(key lru.Key) (value interface{}, ok bool)

read only

func (*CCache) GetRemove

func (c *CCache) GetRemove(key lru.Key) (value interface{}, ok bool)

read and remove

func (*CCache) Len

func (c *CCache) Len() int

func (*CCache) Remove

func (c *CCache) Remove(key lru.Key)

func (*CCache) RemoveOldest

func (c *CCache) RemoveOldest()

func (*CCache) SetMaxEntries

func (c *CCache) SetMaxEntries(maxEntries int)

func (*CCache) SetOnEvicted

func (c *CCache) SetOnEvicted(onEvicted func(key lru.Key, value interface{}))

Jump to

Keyboard shortcuts

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