cache

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 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 CacheWithRemove

type CacheWithRemove interface {
	Cache
	Remove(key string)
}

CacheWithRemove extends the Cache interface with removal capability nolint:golint // Keeping name consistent with other language SDKs

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) Remove

func (l *LRUCache) Remove(key string)

Remove deletes an element from the cache by key

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