Documentation ¶
Overview ¶
Package mock is a generated GoMock package.
Index ¶
- Constants
- func NewClientConnForSQLite(dsn string) (metaModel.ClientConn, error)
- func NewClientConnWithDB(db *sql.DB) metaModel.ClientConn
- func NewMockClientConn() metaModel.ClientConn
- type MetaMock
- func (m *MetaMock) Close() error
- func (m *MetaMock) Delete(ctx context.Context, key string, opts ...metaModel.OpOption) (*metaModel.DeleteResponse, metaModel.Error)
- func (m *MetaMock) Do(ctx context.Context, op metaModel.Op) (metaModel.OpResponse, metaModel.Error)
- func (m *MetaMock) GenEpoch(ctx context.Context) (int64, error)
- func (m *MetaMock) Get(ctx context.Context, key string, opts ...metaModel.OpOption) (*metaModel.GetResponse, metaModel.Error)
- func (m *MetaMock) Put(ctx context.Context, key, value string) (*metaModel.PutResponse, metaModel.Error)
- func (m *MetaMock) Txn(ctx context.Context) metaModel.Txn
- type MockKVClient
- func (m *MockKVClient) Close() error
- func (m *MockKVClient) Delete(arg0 context.Context, arg1 string, arg2 ...model.OpOption) (*model.DeleteResponse, model.Error)
- func (m *MockKVClient) EXPECT() *MockKVClientMockRecorder
- func (m *MockKVClient) GenEpoch(arg0 context.Context) (int64, error)
- func (m *MockKVClient) Get(arg0 context.Context, arg1 string, arg2 ...model.OpOption) (*model.GetResponse, model.Error)
- func (m *MockKVClient) Put(arg0 context.Context, arg1, arg2 string) (*model.PutResponse, model.Error)
- func (m *MockKVClient) Txn(arg0 context.Context) model.Txn
- type MockKVClientMockRecorder
- func (mr *MockKVClientMockRecorder) Close() *gomock.Call
- func (mr *MockKVClientMockRecorder) Delete(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
- func (mr *MockKVClientMockRecorder) GenEpoch(arg0 interface{}) *gomock.Call
- func (mr *MockKVClientMockRecorder) Get(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
- func (mr *MockKVClientMockRecorder) Put(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockKVClientMockRecorder) Txn(arg0 interface{}) *gomock.Call
Constants ¶
const ThreadeSafeSqliteDriverName = "mock-sqlite"
ThreadeSafeSqliteDriverName is a thread-safe sqlite driver implementation.
Variables ¶
This section is empty.
Functions ¶
func NewClientConnForSQLite ¶
func NewClientConnForSQLite(dsn string) (metaModel.ClientConn, error)
NewClientConnForSQLite news a connection of sqlite Only for test
func NewClientConnWithDB ¶
func NewClientConnWithDB(db *sql.DB) metaModel.ClientConn
NewClientConnWithDB news a connection with an sql.DB inside Only for test
func NewMockClientConn ¶
func NewMockClientConn() metaModel.ClientConn
NewMockClientConn news a connection for mock kvclient Only for test
Types ¶
type MetaMock ¶
MetaMock uses a simple in memory kv storage to implement metaModel.Client and metaModel.KV interface. MetaMock is used in unit test. not support Option yet
func (*MetaMock) Delete ¶
func (m *MetaMock) Delete(ctx context.Context, key string, opts ...metaModel.OpOption) (*metaModel.DeleteResponse, metaModel.Error)
Delete implements metaModel.KV.Delete
func (*MetaMock) Get ¶
func (m *MetaMock) Get(ctx context.Context, key string, opts ...metaModel.OpOption) (*metaModel.GetResponse, metaModel.Error)
Get implements metaModel.KV.Get
type MockKVClient ¶
type MockKVClient struct {
// contains filtered or unexported fields
}
MockKVClient is a mock of KVClient interface.
func NewMockKVClient ¶
func NewMockKVClient(ctrl *gomock.Controller) *MockKVClient
NewMockKVClient creates a new mock instance.
func (*MockKVClient) Delete ¶
func (m *MockKVClient) Delete(arg0 context.Context, arg1 string, arg2 ...model.OpOption) (*model.DeleteResponse, model.Error)
Delete mocks base method.
func (*MockKVClient) EXPECT ¶
func (m *MockKVClient) EXPECT() *MockKVClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKVClient) GenEpoch ¶
func (m *MockKVClient) GenEpoch(arg0 context.Context) (int64, error)
GenEpoch mocks base method.
func (*MockKVClient) Get ¶
func (m *MockKVClient) Get(arg0 context.Context, arg1 string, arg2 ...model.OpOption) (*model.GetResponse, model.Error)
Get mocks base method.
func (*MockKVClient) Put ¶
func (m *MockKVClient) Put(arg0 context.Context, arg1, arg2 string) (*model.PutResponse, model.Error)
Put mocks base method.
type MockKVClientMockRecorder ¶
type MockKVClientMockRecorder struct {
// contains filtered or unexported fields
}
MockKVClientMockRecorder is the mock recorder for MockKVClient.
func (*MockKVClientMockRecorder) Close ¶
func (mr *MockKVClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockKVClientMockRecorder) Delete ¶
func (mr *MockKVClientMockRecorder) Delete(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockKVClientMockRecorder) GenEpoch ¶
func (mr *MockKVClientMockRecorder) GenEpoch(arg0 interface{}) *gomock.Call
GenEpoch indicates an expected call of GenEpoch.
func (*MockKVClientMockRecorder) Get ¶
func (mr *MockKVClientMockRecorder) Get(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockKVClientMockRecorder) Put ¶
func (mr *MockKVClientMockRecorder) Put(arg0, arg1, arg2 interface{}) *gomock.Call
Put indicates an expected call of Put.
func (*MockKVClientMockRecorder) Txn ¶
func (mr *MockKVClientMockRecorder) Txn(arg0 interface{}) *gomock.Call
Txn indicates an expected call of Txn.