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 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.
Click to show internal directories.
Click to hide internal directories.