Documentation ¶
Index ¶
- func NewMockTikvStore(options ...MockTiKVStoreOption) (kv.Storage, error)
- type MockDriver
- type MockTiKVStoreOption
- func WithCluster(cluster *mocktikv.Cluster) MockTiKVStoreOption
- func WithHijackClient(wrap func(tikv.Client) tikv.Client) MockTiKVStoreOption
- func WithMVCCStore(store mocktikv.MVCCStore) MockTiKVStoreOption
- func WithPath(path string) MockTiKVStoreOption
- func WithTxnLocalLatches(capacity uint) MockTiKVStoreOption
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.
func WithTxnLocalLatches ¶
func WithTxnLocalLatches(capacity uint) MockTiKVStoreOption
WithTxnLocalLatches enable txnLocalLatches, when capacity > 0.
Click to show internal directories.
Click to hide internal directories.