local_cache

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(b []byte) (s string)

func StringBytes

func StringBytes(s string) []byte

Types

type CacheConfig

type CacheConfig struct {
	CacheTime time.Duration
	CacheSize int
}

type LocalCacheBatch

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

func (*LocalCacheBatch) Delete

func (b *LocalCacheBatch) Delete(key []byte) error

func (*LocalCacheBatch) Put

func (b *LocalCacheBatch) Put(key []byte, value []byte) error

func (*LocalCacheBatch) Replay

func (*LocalCacheBatch) Reset

func (b *LocalCacheBatch) Reset()

func (*LocalCacheBatch) ValueSize

func (b *LocalCacheBatch) ValueSize() int

func (*LocalCacheBatch) Write

func (b *LocalCacheBatch) Write() error

type LocalCacheDatabase

type LocalCacheDatabase struct {
	ethdb.KeyValueStore
	// contains filtered or unexported fields
}

func NewLocalCacheDatabase

func NewLocalCacheDatabase(remoteDB ethdb.KeyValueStore, cacheConfig CacheConfig) *LocalCacheDatabase

func (*LocalCacheDatabase) Delete

func (c *LocalCacheDatabase) Delete(key []byte) error

func (*LocalCacheDatabase) Get

func (c *LocalCacheDatabase) Get(key []byte) (ret []byte, err error)

func (*LocalCacheDatabase) Has

func (c *LocalCacheDatabase) Has(key []byte) (bool, error)

func (*LocalCacheDatabase) NewBatch

func (c *LocalCacheDatabase) NewBatch() ethdb.Batch

func (*LocalCacheDatabase) Put

func (c *LocalCacheDatabase) Put(key []byte, value []byte) error

Jump to

Keyboard shortcuts

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