mockstore

package
v2.0.0-rc.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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