bloblru

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: BSD-2-Clause Imports: 4 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 struct {
	// contains filtered or unexported fields
}

A Cache is a fixed-size LRU cache of blob contents. It is safe for concurrent access.

func New

func New(size int) *Cache

New constructs a blob cache that stores at most size bytes worth of blobs.

func (*Cache) Add

func (c *Cache) Add(id restic.ID, blob []byte) (old []byte)

Add adds key id with value blob to c. It may return an evicted buffer for reuse.

func (*Cache) Get

func (c *Cache) Get(id restic.ID) ([]byte, bool)

Jump to

Keyboard shortcuts

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