cache

package
v0.0.0-...-581f9f3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 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 interface {
	Set(key, value interface{}) error
	SetWithExpire(key, value interface{}, expiration time.Duration) error
	Get(key interface{}) (interface{}, error)
	Remove(key interface{}) bool
}

func NewLRU

func NewLRU(capacity int) Cache

type LRU

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

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