db

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryCache

func NewMemoryCache(size int) *memorydb.LruCache

Types

type Cache

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

func NewFullCache

func NewFullCache(name string, size int) *Cache

func (Cache) Get

func (c Cache) Get(key string) ([]byte, bool)

func (Cache) NewIterator

func (c Cache) NewIterator() iterator.Iterator

func (*Cache) Put

func (c *Cache) Put(key string, value []byte)

type Cacher

type Cacher interface {
	Get(key string) ([]byte, bool)
	Put(key string, value []byte)

	NewIterator() iterator.Iterator
}

type Opts

type Opts struct {
	DataDir    string // Path where the db should be created
	Persistent bool   // Should cache be persisted? (leveldb)
	CacheSize  int    // Size of the in-memory LRU cache
}

type Serializer

type Serializer interface {
	Encode()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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