cache

package
v0.0.0-...-fa4cddc Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheNode

type CacheNode struct {
	Key, Value interface{}
	Expiration int64
}

func (*CacheNode) NewCacheNode

func (cnode *CacheNode) NewCacheNode(k, v interface{}, e int64) *CacheNode

type LRUCache

type LRUCache struct {
	Capacity int
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(cap int) *LRUCache

func (*LRUCache) Get

func (lru *LRUCache) Get(k interface{}) (v interface{}, ret bool, err error)

func (*LRUCache) GetKeys

func (lru *LRUCache) GetKeys(k interface{}, matchFunc func(cacheKey, k interface{}) bool) []interface{}

func (*LRUCache) Remove

func (lru *LRUCache) Remove(k interface{}) bool

func (*LRUCache) Set

func (lru *LRUCache) Set(k, v interface{}) error

func (*LRUCache) SetExpire

func (lru *LRUCache) SetExpire(k, v interface{}, d time.Duration) error

func (*LRUCache) Size

func (lru *LRUCache) Size() int

Jump to

Keyboard shortcuts

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