mock

package
v0.0.0-...-1ba95a4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mock is a generated GoMock package.

Index

Constants

View Source
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

type MetaMock struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 NewMetaMock

func NewMetaMock() *MetaMock

NewMetaMock creates a new MetaMock instance

func (*MetaMock) Close

func (m *MetaMock) Close() error

Close implements pkg/meta/metaModel.Close

func (*MetaMock) Delete

Delete implements metaModel.KV.Delete

func (*MetaMock) Do

Do implements Do of KVExt

func (*MetaMock) GenEpoch

func (m *MetaMock) GenEpoch(ctx context.Context) (int64, error)

GenEpoch implements pkg/meta/metaModel.Client.GenEpoch

func (*MetaMock) Get

Get implements metaModel.KV.Get

func (*MetaMock) Put

func (m *MetaMock) Put(ctx context.Context, key, value string) (*metaModel.PutResponse, metaModel.Error)

Put implements metaModel.KV.Put

func (*MetaMock) Txn

func (m *MetaMock) Txn(ctx context.Context) metaModel.Txn

Txn implements metaModel.KV.Txn

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) Close

func (m *MockKVClient) Close() error

Close mocks base method.

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

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.

func (*MockKVClient) Txn

func (m *MockKVClient) Txn(arg0 context.Context) model.Txn

Txn 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.

Jump to

Keyboard shortcuts

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