cache

package
v0.0.0-...-b12d6b9 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = errors.New("error: key not found")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key string, value interface{}) error
	Get(key string) (interface{}, error)
	Delete(key string) error
}

type LRUCache

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

func NewLRUCache

func NewLRUCache(capacity int) *LRUCache

func (*LRUCache) Delete

func (c *LRUCache) Delete(key string) error

func (*LRUCache) Get

func (c *LRUCache) Get(key string) (interface{}, error)

func (*LRUCache) Set

func (c *LRUCache) Set(key string, value interface{}) error

type Pair

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

Jump to

Keyboard shortcuts

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