tidb: github.com/pingcap/tidb/store/mockstore Index | Files | Directories

package mockstore

import "github.com/pingcap/tidb/store/mockstore"

Index

Package Files

tikv.go

func NewMockTikvStore Uses

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 Uses

type MockDriver struct {
}

MockDriver is in memory mock TiKV driver.

func (MockDriver) Open Uses

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

Open creates a MockTiKV storage.

type MockTiKVStoreOption Uses

type MockTiKVStoreOption func(*mockOptions)

MockTiKVStoreOption is used to control some behavior of mock tikv.

func WithCluster Uses

func WithCluster(cluster *mocktikv.Cluster) MockTiKVStoreOption

WithCluster provides the customized cluster.

func WithHijackClient Uses

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 Uses

func WithMVCCStore(store mocktikv.MVCCStore) MockTiKVStoreOption

WithMVCCStore provides the customized mvcc store.

func WithPath Uses

func WithPath(path string) MockTiKVStoreOption

WithPath specifies the mocktikv path.

func WithTxnLocalLatches Uses

func WithTxnLocalLatches(capacity uint) MockTiKVStoreOption

WithTxnLocalLatches enable txnLocalLatches, when capacity > 0.

Directories

PathSynopsis
mocktikv

Package mockstore imports 8 packages (graph) and is imported by 19 packages. Updated 2019-09-19. Refresh now. Tools for package owners.