cache

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cache //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Save(key string, value interface{})
	Lookup(key string) interface{}
	Reset()
}

Cache is used for caching ODP segments

type LRUCache

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

LRUCache a Least Recently Used in-memory cache

func NewLRUCache

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

NewLRUCache returns a new instance of Least Recently Used in-memory cache

func (*LRUCache) Lookup

func (l *LRUCache) Lookup(key string) interface{}

Lookup retrieves an element from the cache, reordering the elements

func (*LRUCache) Reset

func (l *LRUCache) Reset()

Reset clears all the elements from the cache

func (*LRUCache) Save

func (l *LRUCache) Save(key string, value interface{})

Save stores a new element into the cache

Jump to

Keyboard shortcuts

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