diff --git a/Makefile b/Makefile index f3a8ff8f..5df578db 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ deps: go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc go build -o deps github.com/anyproto/protobuf/protoc-gen-gogofaster -test: mocks +test: go test ./... --cover replace-gogo-strings: diff --git a/nameservice/nameserviceclient/mock/mock_nameserviceclient.go b/nameservice/nameserviceclient/mock/mock_nameserviceclient.go index 253375fe..dac69bbe 100644 --- a/nameservice/nameserviceclient/mock/mock_nameserviceclient.go +++ b/nameservice/nameserviceclient/mock/mock_nameserviceclient.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: nameservice/nameserviceclient/nameserviceclient.go +// Source: github.com/anyproto/any-sync/nameservice/nameserviceclient (interfaces: AnyNsClientService) // // Generated by this command: // -// mockgen -source nameservice/nameserviceclient/nameserviceclient.go +// mockgen -destination=mock/mock_nameserviceclient.go -package=mock_nameserviceclient github.com/anyproto/any-sync/nameservice/nameserviceclient AnyNsClientService // // Package mock_nameserviceclient is a generated GoMock package. @@ -18,151 +18,11 @@ import ( gomock "go.uber.org/mock/gomock" ) -// MockAnyNsClientServiceBase is a mock of AnyNsClientServiceBase interface. -type MockAnyNsClientServiceBase struct { - ctrl *gomock.Controller - recorder *MockAnyNsClientServiceBaseMockRecorder -} - -// MockAnyNsClientServiceBaseMockRecorder is the mock recorder for MockAnyNsClientServiceBase. -type MockAnyNsClientServiceBaseMockRecorder struct { - mock *MockAnyNsClientServiceBase -} - -// NewMockAnyNsClientServiceBase creates a new mock instance. -func NewMockAnyNsClientServiceBase(ctrl *gomock.Controller) *MockAnyNsClientServiceBase { - mock := &MockAnyNsClientServiceBase{ctrl: ctrl} - mock.recorder = &MockAnyNsClientServiceBaseMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAnyNsClientServiceBase) EXPECT() *MockAnyNsClientServiceBaseMockRecorder { - return m.recorder -} - -// BatchGetNameByAddress mocks base method. -func (m *MockAnyNsClientServiceBase) BatchGetNameByAddress(ctx context.Context, in *nameserviceproto.BatchNameByAddressRequest) (*nameserviceproto.BatchNameByAddressResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BatchGetNameByAddress", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.BatchNameByAddressResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BatchGetNameByAddress indicates an expected call of BatchGetNameByAddress. -func (mr *MockAnyNsClientServiceBaseMockRecorder) BatchGetNameByAddress(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetNameByAddress", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).BatchGetNameByAddress), ctx, in) -} - -// BatchGetNameByAnyId mocks base method. -func (m *MockAnyNsClientServiceBase) BatchGetNameByAnyId(ctx context.Context, in *nameserviceproto.BatchNameByAnyIdRequest) (*nameserviceproto.BatchNameByAddressResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BatchGetNameByAnyId", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.BatchNameByAddressResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BatchGetNameByAnyId indicates an expected call of BatchGetNameByAnyId. -func (mr *MockAnyNsClientServiceBaseMockRecorder) BatchGetNameByAnyId(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetNameByAnyId", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).BatchGetNameByAnyId), ctx, in) -} - -// BatchIsNameAvailable mocks base method. -func (m *MockAnyNsClientServiceBase) BatchIsNameAvailable(ctx context.Context, in *nameserviceproto.BatchNameAvailableRequest) (*nameserviceproto.BatchNameAvailableResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BatchIsNameAvailable", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.BatchNameAvailableResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BatchIsNameAvailable indicates an expected call of BatchIsNameAvailable. -func (mr *MockAnyNsClientServiceBaseMockRecorder) BatchIsNameAvailable(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchIsNameAvailable", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).BatchIsNameAvailable), ctx, in) -} - -// GetNameByAddress mocks base method. -func (m *MockAnyNsClientServiceBase) GetNameByAddress(ctx context.Context, in *nameserviceproto.NameByAddressRequest) (*nameserviceproto.NameByAddressResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNameByAddress", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.NameByAddressResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetNameByAddress indicates an expected call of GetNameByAddress. -func (mr *MockAnyNsClientServiceBaseMockRecorder) GetNameByAddress(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNameByAddress", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).GetNameByAddress), ctx, in) -} - -// GetNameByAnyId mocks base method. -func (m *MockAnyNsClientServiceBase) GetNameByAnyId(ctx context.Context, in *nameserviceproto.NameByAnyIdRequest) (*nameserviceproto.NameByAddressResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNameByAnyId", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.NameByAddressResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetNameByAnyId indicates an expected call of GetNameByAnyId. -func (mr *MockAnyNsClientServiceBaseMockRecorder) GetNameByAnyId(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNameByAnyId", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).GetNameByAnyId), ctx, in) -} - -// Init mocks base method. -func (m *MockAnyNsClientServiceBase) Init(a *app.App) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Init", a) - ret0, _ := ret[0].(error) - return ret0 -} - -// Init indicates an expected call of Init. -func (mr *MockAnyNsClientServiceBaseMockRecorder) Init(a any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).Init), a) -} - -// IsNameAvailable mocks base method. -func (m *MockAnyNsClientServiceBase) IsNameAvailable(ctx context.Context, in *nameserviceproto.NameAvailableRequest) (*nameserviceproto.NameAvailableResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsNameAvailable", ctx, in) - ret0, _ := ret[0].(*nameserviceproto.NameAvailableResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// IsNameAvailable indicates an expected call of IsNameAvailable. -func (mr *MockAnyNsClientServiceBaseMockRecorder) IsNameAvailable(ctx, in any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsNameAvailable", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).IsNameAvailable), ctx, in) -} - -// Name mocks base method. -func (m *MockAnyNsClientServiceBase) Name() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) - return ret0 -} - -// Name indicates an expected call of Name. -func (mr *MockAnyNsClientServiceBaseMockRecorder) Name() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAnyNsClientServiceBase)(nil).Name)) -} - // MockAnyNsClientService is a mock of AnyNsClientService interface. type MockAnyNsClientService struct { ctrl *gomock.Controller recorder *MockAnyNsClientServiceMockRecorder + isgomock struct{} } // MockAnyNsClientServiceMockRecorder is the mock recorder for MockAnyNsClientService. diff --git a/nameservice/nameserviceclient/nameserviceclient.go b/nameservice/nameserviceclient/nameserviceclient.go index 6f13c03f..283c4548 100644 --- a/nameservice/nameserviceclient/nameserviceclient.go +++ b/nameservice/nameserviceclient/nameserviceclient.go @@ -1,3 +1,4 @@ +//go:generate mockgen -destination=mock/mock_nameserviceclient.go -package=mock_nameserviceclient github.com/anyproto/any-sync/nameservice/nameserviceclient AnyNsClientService package nameserviceclient import ( diff --git a/paymentservice/paymentserviceclient/mock/mock_paymentserviceclient.go b/paymentservice/paymentserviceclient/mock/mock_paymentserviceclient.go index 7a13c97c..080941a6 100644 --- a/paymentservice/paymentserviceclient/mock/mock_paymentserviceclient.go +++ b/paymentservice/paymentserviceclient/mock/mock_paymentserviceclient.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: paymentservice/paymentserviceclient/paymentserviceclient.go +// Source: github.com/anyproto/any-sync/paymentservice/paymentserviceclient (interfaces: AnyPpClientService) // // Generated by this command: // -// mockgen -source paymentservice/paymentserviceclient/paymentserviceclient.go +// mockgen -destination=mock/mock_paymentserviceclient.go -package=mock_paymentserviceclient github.com/anyproto/any-sync/paymentservice/paymentserviceclient AnyPpClientService // // Package mock_paymentserviceclient is a generated GoMock package. @@ -22,6 +22,7 @@ import ( type MockAnyPpClientService struct { ctrl *gomock.Controller recorder *MockAnyPpClientServiceMockRecorder + isgomock struct{} } // MockAnyPpClientServiceMockRecorder is the mock recorder for MockAnyPpClientService. diff --git a/paymentservice/paymentserviceclient/paymentserviceclient.go b/paymentservice/paymentserviceclient/paymentserviceclient.go index e422f957..dd8f22c2 100644 --- a/paymentservice/paymentserviceclient/paymentserviceclient.go +++ b/paymentservice/paymentserviceclient/paymentserviceclient.go @@ -1,3 +1,4 @@ +//go:generate mockgen -destination=mock/mock_paymentserviceclient.go -package=mock_paymentserviceclient github.com/anyproto/any-sync/paymentservice/paymentserviceclient AnyPpClientService package paymentserviceclient import (