lru

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lru implements simple LRU cache used by Keystore. LRU cache stores in memory some amount of encrypted keys and removes less used keys upon adding new ones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache implement keystore.Cache

func NewCacheKeystoreWrapper

func NewCacheKeystoreWrapper(size int) (*Cache, error)

NewCacheKeystoreWrapper return new *Cache

func (*Cache) Add

func (cache *Cache) Add(keyID string, keyValue []byte)

Add value by keyID

func (*Cache) Clear

func (cache *Cache) Clear()

Clear cache and remove all values with zeroing

func (*Cache) Get

func (cache *Cache) Get(keyID string) ([]byte, bool)

Get value by keyID

Jump to

Keyboard shortcuts

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