cache

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWriter

type BatchWriter interface {
	// Add adds an entry to the batch.
	Add(entry string) error
	// Flush flushes the batch.
	Flush() error
	// Discard discards the batch.
	Discard() error
}

BatchWriter adds batches of entries.

type Cache

type Cache interface {
	// Contains checks if an entry exists.
	Contains(entry string) (bool, error)
	// Add adds an entry.
	Add(entry string) error
	// AddBatch entry
	AddBatch() (BatchWriter, error)
	// Close closes and wipes the cache
	Close() error
}

Cache interface.

func OpenBadger

func OpenBadger(dir string) (Cache, error)

OpenBadger opens a badger DB cache.

Jump to

Keyboard shortcuts

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