vault

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inspector

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

func (*Inspector) AppendRWSet

func (i *Inspector) AppendRWSet(raw []byte, nss ...string) error

func (*Inspector) Bytes

func (i *Inspector) Bytes() ([]byte, error)

func (*Inspector) Clear

func (i *Inspector) Clear(ns string) error

func (*Inspector) DeleteState

func (i *Inspector) DeleteState(namespace string, key string) error

func (*Inspector) Done

func (i *Inspector) Done()

func (*Inspector) Equals

func (i *Inspector) Equals(other interface{}, nss ...string) error

func (*Inspector) GetReadAt

func (i *Inspector) GetReadAt(ns string, pos int) (string, []byte, error)

func (*Inspector) GetReadKeyAt

func (i *Inspector) GetReadKeyAt(ns string, pos int) (string, error)

func (*Inspector) GetState

func (i *Inspector) GetState(namespace string, key string, opts ...driver.GetStateOpt) ([]byte, error)

func (*Inspector) GetStateMetadata

func (i *Inspector) GetStateMetadata(namespace, key string, opts ...driver.GetStateOpt) (map[string][]byte, error)

func (*Inspector) GetWriteAt

func (i *Inspector) GetWriteAt(ns string, pos int) (string, []byte, error)

func (*Inspector) IsValid

func (i *Inspector) IsValid() error

func (*Inspector) Namespaces

func (i *Inspector) Namespaces() []string

func (*Inspector) NumReads

func (i *Inspector) NumReads(ns string) int

func (*Inspector) NumWrites

func (i *Inspector) NumWrites(ns string) int

func (*Inspector) SetState

func (i *Inspector) SetState(namespace string, key string, value []byte) error

func (*Inspector) SetStateMetadata

func (i *Inspector) SetStateMetadata(namespace, key string, metadata map[string][]byte) error

type Interceptor

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

func (*Interceptor) AppendRWSet

func (i *Interceptor) AppendRWSet(raw []byte, nss ...string) error

func (*Interceptor) Bytes

func (i *Interceptor) Bytes() ([]byte, error)

func (*Interceptor) Clear

func (i *Interceptor) Clear(ns string) error

func (*Interceptor) DeleteState

func (i *Interceptor) DeleteState(namespace string, key string) error

func (*Interceptor) Done

func (i *Interceptor) Done()

func (*Interceptor) Equals

func (i *Interceptor) Equals(other interface{}, nss ...string) error

func (*Interceptor) GetReadAt

func (i *Interceptor) GetReadAt(ns string, pos int) (string, []byte, error)

func (*Interceptor) GetReadKeyAt

func (i *Interceptor) GetReadKeyAt(ns string, pos int) (string, error)

func (*Interceptor) GetState

func (i *Interceptor) GetState(namespace string, key string, opts ...driver.GetStateOpt) ([]byte, error)

func (*Interceptor) GetStateMetadata

func (i *Interceptor) GetStateMetadata(namespace, key string, opts ...driver.GetStateOpt) (map[string][]byte, error)

func (*Interceptor) GetWriteAt

func (i *Interceptor) GetWriteAt(ns string, pos int) (string, []byte, error)

func (*Interceptor) IsValid

func (i *Interceptor) IsValid() error

func (*Interceptor) Namespaces

func (i *Interceptor) Namespaces() []string

func (*Interceptor) NumReads

func (i *Interceptor) NumReads(ns string) int

func (*Interceptor) NumWrites

func (i *Interceptor) NumWrites(ns string) int

func (*Interceptor) SetState

func (i *Interceptor) SetState(namespace string, key string, value []byte) error

func (*Interceptor) SetStateMetadata

func (i *Interceptor) SetStateMetadata(namespace string, key string, value map[string][]byte) error

type QueryExecutor

type QueryExecutor interface {
	GetStateMetadata(namespace, key string) (map[string][]byte, uint64, uint64, error)
	GetState(namespace, key string) ([]byte, uint64, uint64, error)
	Done()
}

type TXIDStore

type TXIDStore interface {
	TXIDStoreReader
	Set(txid string, code fdriver.ValidationCode) error
}

type TXIDStoreReader

type TXIDStoreReader interface {
	Get(txid string) (fdriver.ValidationCode, error)
}

type Vault

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

Vault models a key-value store that can be modified by committing rwsets

func New

func New(store driver.VersionedPersistence, txIDStore TXIDStore) *Vault

New returns a new instance of Vault

func (*Vault) Close

func (db *Vault) Close() error

func (*Vault) CommitTX

func (db *Vault) CommitTX(txid string, block uint64, indexInBloc int) error

func (*Vault) DiscardTx

func (db *Vault) DiscardTx(txid string) error

func (*Vault) GetRWSet

func (db *Vault) GetRWSet(txid string, rwsetBytes []byte) (*Interceptor, error)

func (*Vault) InspectRWSet

func (db *Vault) InspectRWSet(rwsetBytes []byte, namespaces ...string) (*Inspector, error)

func (*Vault) Match

func (db *Vault) Match(txid string, rwsRaw []byte) error

func (*Vault) NewQueryExecutor

func (db *Vault) NewQueryExecutor() (fdriver.QueryExecutor, error)

func (*Vault) NewRWSet

func (db *Vault) NewRWSet(txid string) (*Interceptor, error)

func (*Vault) RWSExists

func (db *Vault) RWSExists(txid string) bool

func (*Vault) SetBusy

func (db *Vault) SetBusy(txid string) error

func (*Vault) Status

func (db *Vault) Status(txid string) (fdriver.ValidationCode, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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