cache

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 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 Cache

type Cache interface {
	Set(key, value interface{}) error
	SetWithExpire(key, value interface{}, expiration time.Duration) error
	Get(key interface{}) (interface{}, error)
	Remove(key interface{}) bool
}

func NewCache

func NewCache(capacity int, enable bool) Cache

type LRU

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

func (*LRU) Disable

func (l *LRU) Disable()

func (*LRU) Enable

func (l *LRU) Enable()

func (*LRU) Expire

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

func (LRU) Get

func (l LRU) Get(key interface{}) (interface{}, error)

func (*LRU) Remove

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

func (*LRU) Set

func (l *LRU) Set(key, value interface{}) error

func (*LRU) SetWithExpire

func (l *LRU) SetWithExpire(key, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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