cache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDuration time.Duration = 0

Functions

This section is empty.

Types

type Cache

type Cache struct {
	*LRUCache
}

func New

func New(size int, defaultExpiretion time.Duration, cleanupInterval time.Duration) *Cache

type LRU

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

func NewLRU

func NewLRU(size int) *LRU

func (*LRU) Contains

func (l *LRU) Contains(key interface{}) bool

func (*LRU) Delete

func (l *LRU) Delete(key interface{})

func (*LRU) Insert

func (l *LRU) Insert(key interface{}) (evicted_data interface{}, evicted bool)

func (*LRU) MoveToFront

func (l *LRU) MoveToFront(key interface{})

type LRUCache

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

func NewLRUCache

func NewLRUCache(size int, defaultExpiretion time.Duration) *LRUCache

func (*LRUCache) Delete

func (c *LRUCache) Delete(key interface{})

func (*LRUCache) DeleteExpired

func (c *LRUCache) DeleteExpired()

func (*LRUCache) Get

func (c *LRUCache) Get(key interface{}) interface{}

func (*LRUCache) Len

func (c *LRUCache) Len() int

func (*LRUCache) Range

func (c *LRUCache) Range() []interface{}

func (*LRUCache) Set

func (c *LRUCache) Set(key interface{}, value interface{}, duration time.Duration)

func (*LRUCache) SetDefault

func (c *LRUCache) SetDefault(key interface{}, value interface{})

func (*LRUCache) SetDefaultWithUuidKey

func (c *LRUCache) SetDefaultWithUuidKey(value interface{}) (key string)

func (*LRUCache) SetWithUuidKey

func (c *LRUCache) SetWithUuidKey(value interface{}, duration time.Duration) (key string)

type List

type List struct {
	Len int64
	// contains filtered or unexported fields
}

func NewList

func NewList() *List

func (*List) Contains

func (l *List) Contains(data interface{}) bool

func (*List) Delete

func (l *List) Delete(data interface{})

func (*List) DeleteHead

func (l *List) DeleteHead() (data interface{})

func (*List) DeleteTail

func (l *List) DeleteTail() (data interface{})

func (*List) Insert

func (l *List) Insert(data interface{})

func (*List) Range

func (l *List) Range() []interface{}

type Node

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

Jump to

Keyboard shortcuts

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