cache

package
v0.0.0-...-6ce5408 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheData

type CacheData struct {
	DB       *leveldb.DB
	FileName string
	Opt      *opt.Options
}

func NewCacheData

func NewCacheData(file string) *CacheData

func (*CacheData) BeginTx

func (c *CacheData) BeginTx() (*CacheDataTx, error)

func (*CacheData) Close

func (c *CacheData) Close() error

func (*CacheData) Delete

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

func (*CacheData) Get

func (c *CacheData) Get(key []byte) ([]byte, error)

func (*CacheData) Has

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

func (*CacheData) Put

func (c *CacheData) Put(key, val []byte) error

func (*CacheData) RunAll

func (c *CacheData) RunAll(fn func(string, string) error, isStop bool) error

type CacheDataTx

type CacheDataTx struct {
	Tr *leveldb.Transaction
}

func (*CacheDataTx) Commit

func (t *CacheDataTx) Commit() error

func (*CacheDataTx) Delete

func (t *CacheDataTx) Delete(key []byte) error

func (*CacheDataTx) Discard

func (t *CacheDataTx) Discard() error

func (*CacheDataTx) Get

func (t *CacheDataTx) Get(key []byte) ([]byte, error)

func (*CacheDataTx) Has

func (t *CacheDataTx) Has(key []byte) (bool, error)

func (*CacheDataTx) Put

func (t *CacheDataTx) Put(key, val []byte) error

Jump to

Keyboard shortcuts

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