store

package
v0.0.0-...-1c4572a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyRoot [32]byte

Functions

func DisableLog

func DisableLog()

func Reg

func Reg(name string, create StoreCreate)

func SetLogLevel

func SetLogLevel(level string)

Types

type BaseStore

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

func NewBaseStore

func NewBaseStore(cfg *types.Store) *BaseStore

driver dbpath

func (*BaseStore) Close

func (store *BaseStore) Close()

func (*BaseStore) GetDB

func (store *BaseStore) GetDB() dbm.DB

func (*BaseStore) GetQueueClient

func (store *BaseStore) GetQueueClient() queue.Client

func (*BaseStore) SetChild

func (store *BaseStore) SetChild(sub SubStore)

func (*BaseStore) SetQueueClient

func (store *BaseStore) SetQueueClient(c queue.Client)

type StoreCreate

type StoreCreate func(cfg *types.Store, sub []byte) queue.Module

func Load

func Load(name string) (create StoreCreate, err error)

type SubStore

type SubStore interface {
	Set(datas *types.StoreSet, sync bool) ([]byte, error)
	Get(datas *types.StoreGet) [][]byte
	MemSet(datas *types.StoreSet, sync bool) ([]byte, error)
	Commit(hash *types.ReqHash) ([]byte, error)
	Rollback(req *types.ReqHash) ([]byte, error)
	Del(req *types.StoreDel) ([]byte, error)
	IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)
	ProcEvent(msg queue.Message)
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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