lru

package
v0.0.0-...-ae13d62 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 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 Cache

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

Hash table + bidirectional linked list to achieve lru

func NewCache

func NewCache(capacity int) *Cache

func (*Cache) CacheData

func (c *Cache) CacheData() map[string]*list.Element

func (*Cache) Delete

func (c *Cache) Delete(key string) bool

func (*Cache) Get

func (c *Cache) Get(key string) (string, bool)

func (*Cache) Set

func (c *Cache) Set(key string, value string, ttl ...int64)

func (*Cache) UpdateCapacity

func (c *Cache) UpdateCapacity(capacity int)

Jump to

Keyboard shortcuts

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