Version: v0.0.0-...-d60a1a2 Latest Latest

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 8 Imported by: 0




This section is empty.


This section is empty.


func NewMockTikvStore

func NewMockTikvStore(options ...MockTiKVStoreOption) (kv.Storage, error)

NewMockTikvStore creates a mocked tikv store, the path is the file path to store the data. If path is an empty string, a memory storage will be created.


type MockDriver

type MockDriver struct {

MockDriver is in memory mock TiKV driver.

func (MockDriver) Open

func (d MockDriver) Open(path string) (kv.Storage, error)

Open creates a MockTiKV storage.

type MockTiKVStoreOption

type MockTiKVStoreOption func(*mockOptions)

MockTiKVStoreOption is used to control some behavior of mock tikv.

func WithCluster

func WithCluster(cluster *mocktikv.Cluster) MockTiKVStoreOption

WithCluster provides the customized cluster.

func WithHijackClient

func WithHijackClient(wrap func(tikv.Client) tikv.Client) MockTiKVStoreOption

WithHijackClient hijacks KV client's behavior, makes it easy to simulate the network problem between TiDB and TiKV.

func WithMVCCStore

func WithMVCCStore(store mocktikv.MVCCStore) MockTiKVStoreOption

WithMVCCStore provides the customized mvcc store.

func WithPath

func WithPath(path string) MockTiKVStoreOption

WithPath specifies the mocktikv path.

func WithTxnLocalLatches

func WithTxnLocalLatches(capacity uint) MockTiKVStoreOption

WithTxnLocalLatches enable txnLocalLatches, when capacity > 0.

Source Files


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL