mock

package
v0.0.0-...-8f391c2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package utils is a generated GoMock package.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package mock_nacos is a generated GoMock package.

Package qiniu is a generated GoMock package.

Package utils is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var Result = make(map[string]bson.M)

Functions

func NewCustomComponentMock

func NewCustomComponentMock() custom.Component

Types

type CustomComponentMock

type CustomComponentMock struct {
	// contains filtered or unexported fields
}

func (*CustomComponentMock) GetReceivedConfig

func (c *CustomComponentMock) GetReceivedConfig() *custom.Config

func (*CustomComponentMock) GetReceivedCtx

func (c *CustomComponentMock) GetReceivedCtx() context.Context

func (*CustomComponentMock) InitTimes

func (c *CustomComponentMock) InitTimes() int

func (*CustomComponentMock) Initialize

func (c *CustomComponentMock) Initialize(ctx context.Context, config custom.Config) error

type MockBucketManager

type MockBucketManager struct {
	// contains filtered or unexported fields
}

MockBucketManager is a mock of BucketManager interface.

func NewMockBucketManager

func NewMockBucketManager(ctrl *gomock.Controller) *MockBucketManager

NewMockBucketManager creates a new mock instance.

func (*MockBucketManager) Delete

func (m *MockBucketManager) Delete(bucket, key string) error

Delete mocks base method.

func (*MockBucketManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBucketManager) ListFiles

func (m *MockBucketManager) ListFiles(bucket, prefix, delimiter, marker string, limit int) ([]storage.ListItem, []string, string, bool, error)

ListFiles mocks base method.

func (*MockBucketManager) Stat

func (m *MockBucketManager) Stat(bucket, key string) (storage.FileInfo, error)

Stat mocks base method.

type MockBucketManagerMockRecorder

type MockBucketManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockBucketManagerMockRecorder is the mock recorder for MockBucketManager.

func (*MockBucketManagerMockRecorder) Delete

func (mr *MockBucketManagerMockRecorder) Delete(bucket, key interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockBucketManagerMockRecorder) ListFiles

func (mr *MockBucketManagerMockRecorder) ListFiles(bucket, prefix, delimiter, marker, limit interface{}) *gomock.Call

ListFiles indicates an expected call of ListFiles.

func (*MockBucketManagerMockRecorder) Stat

func (mr *MockBucketManagerMockRecorder) Stat(bucket, key interface{}) *gomock.Call

Stat indicates an expected call of Stat.

type MockConnectionFactory

type MockConnectionFactory struct {
	// contains filtered or unexported fields
}

MockConnectionFactory is a mock of ConnectionFactory interface.

func NewMockConnectionFactory

func NewMockConnectionFactory(ctrl *gomock.Controller) *MockConnectionFactory

NewMockConnectionFactory creates a new mock instance.

func (*MockConnectionFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockConnectionFactory) NewConnection

NewConnection mocks base method.

type MockConnectionFactoryMockRecorder

type MockConnectionFactoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockConnectionFactoryMockRecorder is the mock recorder for MockConnectionFactory.

func (*MockConnectionFactoryMockRecorder) NewConnection

func (mr *MockConnectionFactoryMockRecorder) NewConnection(expire, meta interface{}) *gomock.Call

NewConnection indicates an expected call of NewConnection.

type MockConsulClient

type MockConsulClient struct {
	// contains filtered or unexported fields
}

MockConsulClient is a mock of ConsulClient interface.

func NewMockConsulClient

func NewMockConsulClient(ctrl *gomock.Controller) *MockConsulClient

NewMockConsulClient creates a new mock instance.

func (*MockConsulClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockConsulClient) Session

func (m *MockConsulClient) Session() *api.Session

Session mocks base method.

type MockConsulClientMockRecorder

type MockConsulClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockConsulClientMockRecorder is the mock recorder for MockConsulClient.

func (*MockConsulClientMockRecorder) Session

func (mr *MockConsulClientMockRecorder) Session() *gomock.Call

Session indicates an expected call of Session.

type MockConsulKV

type MockConsulKV struct {
	// contains filtered or unexported fields
}

MockConsulKV is a mock of ConsulKV interface.

func NewMockConsulKV

func NewMockConsulKV(ctrl *gomock.Controller) *MockConsulKV

NewMockConsulKV creates a new mock instance.

func (*MockConsulKV) Acquire

func (m *MockConsulKV) Acquire(p *api.KVPair, q *api.WriteOptions) (bool, *api.WriteMeta, error)

Acquire mocks base method.

func (*MockConsulKV) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockConsulKV) Release

func (m *MockConsulKV) Release(p *api.KVPair, q *api.WriteOptions) (bool, *api.WriteMeta, error)

Release mocks base method.

type MockConsulKVMockRecorder

type MockConsulKVMockRecorder struct {
	// contains filtered or unexported fields
}

MockConsulKVMockRecorder is the mock recorder for MockConsulKV.

func (*MockConsulKVMockRecorder) Acquire

func (mr *MockConsulKVMockRecorder) Acquire(p, q interface{}) *gomock.Call

Acquire indicates an expected call of Acquire.

func (*MockConsulKVMockRecorder) Release

func (mr *MockConsulKVMockRecorder) Release(p, q interface{}) *gomock.Call

Release indicates an expected call of Release.

type MockFormUploader

type MockFormUploader struct {
	// contains filtered or unexported fields
}

MockFormUploader is a mock of FormUploader interface.

func NewMockFormUploader

func NewMockFormUploader(ctrl *gomock.Controller) *MockFormUploader

NewMockFormUploader creates a new mock instance.

func (*MockFormUploader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFormUploader) Put

func (m *MockFormUploader) Put(ctx context.Context, ret interface{}, uptoken, key string, data io.Reader, size int64, extra *storage.PutExtra) error

Put mocks base method.

type MockFormUploaderMockRecorder

type MockFormUploaderMockRecorder struct {
	// contains filtered or unexported fields
}

MockFormUploaderMockRecorder is the mock recorder for MockFormUploader.

func (*MockFormUploaderMockRecorder) Put

func (mr *MockFormUploaderMockRecorder) Put(ctx, ret, uptoken, key, data, size, extra interface{}) *gomock.Call

Put indicates an expected call of Put.

type MockMongoClient

type MockMongoClient struct{}

MockMongoClient is a mock of MongoClient interface

func NewMockMongoClient

func NewMockMongoClient() *MockMongoClient

func (*MockMongoClient) Database

func (c *MockMongoClient) Database(name string, opts ...*options.DatabaseOptions) *mongo.Database

func (*MockMongoClient) Disconnect

func (c *MockMongoClient) Disconnect(ctx context.Context) error

func (*MockMongoClient) Ping

func (*MockMongoClient) StartSession

func (c *MockMongoClient) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)

type MockMongoCollection

type MockMongoCollection struct {
	// '_id' document
	Result           map[string]bson.M
	InsertManyResult *mongo.InsertManyResult
	InsertOneResult  *mongo.InsertOneResult
	SingleResult     *mongo.SingleResult
	DeleteResult     *mongo.DeleteResult
}

MockMongoCollection is a mock of MongoCollection interface

func NewMockMongoCollection

func NewMockMongoCollection() *MockMongoCollection

func (*MockMongoCollection) DeleteOne

func (mc *MockMongoCollection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

func (*MockMongoCollection) Find

func (mc *MockMongoCollection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)

func (*MockMongoCollection) FindOne

func (mc *MockMongoCollection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult

func (*MockMongoCollection) FindOneAndUpdate

func (mc *MockMongoCollection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult

func (*MockMongoCollection) Indexes

func (mc *MockMongoCollection) Indexes() mongo.IndexView

func (*MockMongoCollection) InsertOne

func (mc *MockMongoCollection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MockMongoCollection) UpdateOne

func (mc *MockMongoCollection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

type MockMongoFactory

type MockMongoFactory struct{}

func NewMockMongoFactory

func NewMockMongoFactory() *MockMongoFactory

func (*MockMongoFactory) NewMongoClient

func (f *MockMongoFactory) NewMongoClient(m utils.MongoMetadata) (utils.MongoClient, error)

func (*MockMongoFactory) NewMongoCollection

func (f *MockMongoFactory) NewMongoCollection(m *mongo.Database, collectionName string, opts *options.CollectionOptions) utils.MongoCollection

func (*MockMongoFactory) NewSingleResult

func (f *MockMongoFactory) NewSingleResult(sr *mongo.SingleResult) utils.MongoSingleResult

type MockMongoSequencerClient

type MockMongoSequencerClient struct{}

MockMongoClient is a mock of MongoClient interface

func (*MockMongoSequencerClient) Database

func (*MockMongoSequencerClient) Disconnect

func (c *MockMongoSequencerClient) Disconnect(ctx context.Context) error

func (*MockMongoSequencerClient) Ping

func (*MockMongoSequencerClient) StartSession

func (c *MockMongoSequencerClient) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)

type MockMongoSequencerCollection

type MockMongoSequencerCollection struct {
	// '_id' document
	InsertOneResult *mongo.InsertOneResult
	Result          map[string]bson.M
}

MockMongoCollection is a mock of MongoCollection interface

func (*MockMongoSequencerCollection) DeleteOne

func (mc *MockMongoSequencerCollection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

func (*MockMongoSequencerCollection) Find

func (mc *MockMongoSequencerCollection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)

func (*MockMongoSequencerCollection) FindOne

func (mc *MockMongoSequencerCollection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult

func (*MockMongoSequencerCollection) FindOneAndUpdate

func (mc *MockMongoSequencerCollection) FindOneAndUpdate(ctx context.Context, filter interface{},
	update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult

func (*MockMongoSequencerCollection) Indexes

func (*MockMongoSequencerCollection) InsertOne

func (mc *MockMongoSequencerCollection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MockMongoSequencerCollection) UpdateOne

func (mc *MockMongoSequencerCollection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

type MockMongoSequencerFactory

type MockMongoSequencerFactory struct{}

func NewMockMongoSequencerFactory

func NewMockMongoSequencerFactory() *MockMongoSequencerFactory

func (*MockMongoSequencerFactory) NewMongoClient

func (*MockMongoSequencerFactory) NewMongoCollection

func (f *MockMongoSequencerFactory) NewMongoCollection(m *mongo.Database, collectionName string, opts *options.CollectionOptions) utils.MongoCollection

func (*MockMongoSequencerFactory) NewSingleResult

type MockMongoSequencerSession

type MockMongoSequencerSession struct {
	mongo.SessionContext
}

MockMongoSession is a mock of MongoSession interface

func NewMockMongoSequencerSession

func NewMockMongoSequencerSession() *MockMongoSequencerSession

func (*MockMongoSequencerSession) AbortTransaction

func (s *MockMongoSequencerSession) AbortTransaction(context.Context) error

func (*MockMongoSequencerSession) CommitTransaction

func (s *MockMongoSequencerSession) CommitTransaction(context.Context) error

func (*MockMongoSequencerSession) EndSession

func (s *MockMongoSequencerSession) EndSession(context.Context)

func (*MockMongoSequencerSession) WithTransaction

func (s *MockMongoSequencerSession) WithTransaction(ctx context.Context, fn func(sessCtx mongo.SessionContext) (interface{}, error),
	opts ...*options.TransactionOptions) (interface{}, error)

type MockMongoSequencerSingleResult

type MockMongoSequencerSingleResult struct{}

func (*MockMongoSequencerSingleResult) Decode

func (d *MockMongoSequencerSingleResult) Decode(v interface{}) error

func (*MockMongoSequencerSingleResult) DecodeBytes

func (d *MockMongoSequencerSingleResult) DecodeBytes() (bson.Raw, error)

func (*MockMongoSequencerSingleResult) Err

type MockMongoSession

type MockMongoSession struct {
	mongo.SessionContext
}

MockMongoSession is a mock of MongoSession interface

func NewMockMongoSession

func NewMockMongoSession() *MockMongoSession

func (*MockMongoSession) AbortTransaction

func (s *MockMongoSession) AbortTransaction(context.Context) error

func (*MockMongoSession) CommitTransaction

func (s *MockMongoSession) CommitTransaction(context.Context) error

func (*MockMongoSession) EndSession

func (s *MockMongoSession) EndSession(context.Context)

func (*MockMongoSession) WithTransaction

func (s *MockMongoSession) WithTransaction(ctx context.Context, fn func(sessCtx mongo.SessionContext) (interface{}, error),
	opts ...*options.TransactionOptions) (interface{}, error)

type MockNacosConfigClient

type MockNacosConfigClient struct {
	// contains filtered or unexported fields
}

MockNacosConfigClient is a mock of NacosConfigClient interface.

func NewMockNacosConfigClient

func NewMockNacosConfigClient(ctrl *gomock.Controller) *MockNacosConfigClient

NewMockNacosConfigClient creates a new mock instance.

func (*MockNacosConfigClient) CancelListenConfig

func (m *MockNacosConfigClient) CancelListenConfig(params vo.ConfigParam) error

CancelListenConfig mocks base method.

func (*MockNacosConfigClient) CloseClient

func (m *MockNacosConfigClient) CloseClient()

CloseClient mocks base method.

func (*MockNacosConfigClient) DeleteConfig

func (m *MockNacosConfigClient) DeleteConfig(param vo.ConfigParam) (bool, error)

DeleteConfig mocks base method.

func (*MockNacosConfigClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockNacosConfigClient) GetConfig

func (m *MockNacosConfigClient) GetConfig(param vo.ConfigParam) (string, error)

GetConfig mocks base method.

func (*MockNacosConfigClient) ListenConfig

func (m *MockNacosConfigClient) ListenConfig(params vo.ConfigParam) error

ListenConfig mocks base method.

func (*MockNacosConfigClient) PublishConfig

func (m *MockNacosConfigClient) PublishConfig(param vo.ConfigParam) (bool, error)

PublishConfig mocks base method.

func (*MockNacosConfigClient) SearchConfig

func (m *MockNacosConfigClient) SearchConfig(param vo.SearchConfigParam) (*model.ConfigPage, error)

SearchConfig mocks base method.

type MockNacosConfigClientMockRecorder

type MockNacosConfigClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockNacosConfigClientMockRecorder is the mock recorder for MockNacosConfigClient.

func (*MockNacosConfigClientMockRecorder) CancelListenConfig

func (mr *MockNacosConfigClientMockRecorder) CancelListenConfig(params interface{}) *gomock.Call

CancelListenConfig indicates an expected call of CancelListenConfig.

func (*MockNacosConfigClientMockRecorder) CloseClient

func (mr *MockNacosConfigClientMockRecorder) CloseClient() *gomock.Call

CloseClient indicates an expected call of CloseClient.

func (*MockNacosConfigClientMockRecorder) DeleteConfig

func (mr *MockNacosConfigClientMockRecorder) DeleteConfig(param interface{}) *gomock.Call

DeleteConfig indicates an expected call of DeleteConfig.

func (*MockNacosConfigClientMockRecorder) GetConfig

func (mr *MockNacosConfigClientMockRecorder) GetConfig(param interface{}) *gomock.Call

GetConfig indicates an expected call of GetConfig.

func (*MockNacosConfigClientMockRecorder) ListenConfig

func (mr *MockNacosConfigClientMockRecorder) ListenConfig(params interface{}) *gomock.Call

ListenConfig indicates an expected call of ListenConfig.

func (*MockNacosConfigClientMockRecorder) PublishConfig

func (mr *MockNacosConfigClientMockRecorder) PublishConfig(param interface{}) *gomock.Call

PublishConfig indicates an expected call of PublishConfig.

func (*MockNacosConfigClientMockRecorder) SearchConfig

func (mr *MockNacosConfigClientMockRecorder) SearchConfig(param interface{}) *gomock.Call

SearchConfig indicates an expected call of SearchConfig.

type MockSessionFactory

type MockSessionFactory struct {
	// contains filtered or unexported fields
}

MockSessionFactory is a mock of SessionFactory interface.

func NewMockSessionFactory

func NewMockSessionFactory(ctrl *gomock.Controller) *MockSessionFactory

NewMockSessionFactory creates a new mock instance.

func (*MockSessionFactory) Create

Create mocks base method.

func (*MockSessionFactory) Destroy

func (m *MockSessionFactory) Destroy(id string, q *api.WriteOptions) (*api.WriteMeta, error)

Destroy mocks base method.

func (*MockSessionFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockSessionFactoryMockRecorder

type MockSessionFactoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockSessionFactoryMockRecorder is the mock recorder for MockSessionFactory.

func (*MockSessionFactoryMockRecorder) Create

func (mr *MockSessionFactoryMockRecorder) Create(se, q interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockSessionFactoryMockRecorder) Destroy

func (mr *MockSessionFactoryMockRecorder) Destroy(id, q interface{}) *gomock.Call

Destroy indicates an expected call of Destroy.

type MockZKConnection

type MockZKConnection struct {
	// contains filtered or unexported fields
}

MockZKConnection is a mock of ZKConnection interface.

func NewMockZKConnection

func NewMockZKConnection(ctrl *gomock.Controller) *MockZKConnection

NewMockZKConnection creates a new mock instance.

func (*MockZKConnection) Close

func (m *MockZKConnection) Close()

Close mocks base method.

func (*MockZKConnection) Create

func (m *MockZKConnection) Create(path string, data []byte, flags int32, acl []zk.ACL) (string, error)

Create mocks base method.

func (*MockZKConnection) Delete

func (m *MockZKConnection) Delete(path string, version int32) error

Delete mocks base method.

func (*MockZKConnection) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockZKConnection) Get

func (m *MockZKConnection) Get(path string) ([]byte, *zk.Stat, error)

Get mocks base method.

func (*MockZKConnection) Set

func (m *MockZKConnection) Set(path string, data []byte, version int32) (*zk.Stat, error)

Set mocks base method.

type MockZKConnectionMockRecorder

type MockZKConnectionMockRecorder struct {
	// contains filtered or unexported fields
}

MockZKConnectionMockRecorder is the mock recorder for MockZKConnection.

func (*MockZKConnectionMockRecorder) Close

Close indicates an expected call of Close.

func (*MockZKConnectionMockRecorder) Create

func (mr *MockZKConnectionMockRecorder) Create(path, data, flags, acl interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockZKConnectionMockRecorder) Delete

func (mr *MockZKConnectionMockRecorder) Delete(path, version interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockZKConnectionMockRecorder) Get

func (mr *MockZKConnectionMockRecorder) Get(path interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockZKConnectionMockRecorder) Set

func (mr *MockZKConnectionMockRecorder) Set(path, data, version interface{}) *gomock.Call

Set indicates an expected call of Set.

Jump to

Keyboard shortcuts

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