diff --git a/Makefile b/Makefile index 19c7ad58..0ba9e8c4 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ style: mocks: find . -name "mocks" -type d -exec rm -r "{}" \+ go generate -run mockgen $(PACKAGES) - mockgen -destination pkg/mocks/pgx.go -mock_names Row=Row,Rows=Rows -package mocks github.com/jackc/pgx/v4 Row,Rows + mockgen -destination pkg/mocks/pgx.go -package mocks -mock_names Row=Row,Rows=Rows github.com/jackc/pgx/v4 Row,Rows ## test: Shortcut to launch all the test tasks (unit, functional and integration). .PHONY: test diff --git a/pkg/mocks/auth_service.go b/pkg/mocks/auth_service.go deleted file mode 100644 index 2a969134..00000000 --- a/pkg/mocks/auth_service.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: AuthService) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/auth/v2/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// AuthService is a mock of AuthService interface. -type AuthService struct { - ctrl *gomock.Controller - recorder *AuthServiceMockRecorder -} - -// AuthServiceMockRecorder is the mock recorder for AuthService. -type AuthServiceMockRecorder struct { - mock *AuthService -} - -// NewAuthService creates a new mock instance. -func NewAuthService(ctrl *gomock.Controller) *AuthService { - mock := &AuthService{ctrl: ctrl} - mock.recorder = &AuthServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *AuthService) EXPECT() *AuthServiceMockRecorder { - return m.recorder -} - -// Check mocks base method. -func (m *AuthService) Check(arg0 context.Context, arg1, arg2 model.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Check", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Check indicates an expected call of Check. -func (mr *AuthServiceMockRecorder) Check(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Check", reflect.TypeOf((*AuthService)(nil).Check), arg0, arg1, arg2) -} - -// Create mocks base method. -func (m *AuthService) Create(arg0 context.Context, arg1 model.User) (model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *AuthServiceMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*AuthService)(nil).Create), arg0, arg1) -} diff --git a/pkg/mocks/database.go b/pkg/mocks/database.go index e2168590..fcceb138 100644 --- a/pkg/mocks/database.go +++ b/pkg/mocks/database.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: Database) +// Source: database.go // Package mocks is a generated GoMock package. package mocks @@ -36,7 +36,7 @@ func (m *Database) EXPECT() *DatabaseMockRecorder { } // Create mocks base method. -func (m *Database) Create(arg0 context.Context, arg1 string, arg2 ...interface{}) (uint64, error) { +func (m *Database) Create(arg0 context.Context, arg1 string, arg2 ...any) (uint64, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { @@ -70,7 +70,7 @@ func (mr *DatabaseMockRecorder) DoAtomic(arg0, arg1 interface{}) *gomock.Call { } // Exec mocks base method. -func (m *Database) Exec(arg0 context.Context, arg1 string, arg2 ...interface{}) error { +func (m *Database) Exec(arg0 context.Context, arg1 string, arg2 ...any) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { @@ -89,7 +89,7 @@ func (mr *DatabaseMockRecorder) Exec(arg0, arg1 interface{}, arg2 ...interface{} } // Get mocks base method. -func (m *Database) Get(arg0 context.Context, arg1 func(pgx.Row) error, arg2 string, arg3 ...interface{}) error { +func (m *Database) Get(arg0 context.Context, arg1 func(pgx.Row) error, arg2 string, arg3 ...any) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1, arg2} for _, a := range arg3 { @@ -108,7 +108,7 @@ func (mr *DatabaseMockRecorder) Get(arg0, arg1, arg2 interface{}, arg3 ...interf } // List mocks base method. -func (m *Database) List(arg0 context.Context, arg1 func(pgx.Rows) error, arg2 string, arg3 ...interface{}) error { +func (m *Database) List(arg0 context.Context, arg1 func(pgx.Rows) error, arg2 string, arg3 ...any) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1, arg2} for _, a := range arg3 { @@ -127,7 +127,7 @@ func (mr *DatabaseMockRecorder) List(arg0, arg1, arg2 interface{}, arg3 ...inter } // One mocks base method. -func (m *Database) One(arg0 context.Context, arg1 string, arg2 ...interface{}) error { +func (m *Database) One(arg0 context.Context, arg1 string, arg2 ...any) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { diff --git a/pkg/mocks/generic_provider.go b/pkg/mocks/generic_provider.go deleted file mode 100644 index 5fab9e41..00000000 --- a/pkg/mocks/generic_provider.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: GenericProvider) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - semver "github.com/ViBiOh/ketchup/pkg/semver" - gomock "github.com/golang/mock/gomock" -) - -// GenericProvider is a mock of GenericProvider interface. -type GenericProvider struct { - ctrl *gomock.Controller - recorder *GenericProviderMockRecorder -} - -// GenericProviderMockRecorder is the mock recorder for GenericProvider. -type GenericProviderMockRecorder struct { - mock *GenericProvider -} - -// NewGenericProvider creates a new mock instance. -func NewGenericProvider(ctrl *gomock.Controller) *GenericProvider { - mock := &GenericProvider{ctrl: ctrl} - mock.recorder = &GenericProviderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *GenericProvider) EXPECT() *GenericProviderMockRecorder { - return m.recorder -} - -// LatestVersions mocks base method. -func (m *GenericProvider) LatestVersions(arg0 context.Context, arg1 string, arg2 []string) (map[string]semver.Version, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestVersions", arg0, arg1, arg2) - ret0, _ := ret[0].(map[string]semver.Version) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestVersions indicates an expected call of LatestVersions. -func (mr *GenericProviderMockRecorder) LatestVersions(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestVersions", reflect.TypeOf((*GenericProvider)(nil).LatestVersions), arg0, arg1, arg2) -} diff --git a/pkg/mocks/helm_provider.go b/pkg/mocks/helm_provider.go deleted file mode 100644 index 2779d954..00000000 --- a/pkg/mocks/helm_provider.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: HelmProvider) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - semver "github.com/ViBiOh/ketchup/pkg/semver" - gomock "github.com/golang/mock/gomock" -) - -// HelmProvider is a mock of HelmProvider interface. -type HelmProvider struct { - ctrl *gomock.Controller - recorder *HelmProviderMockRecorder -} - -// HelmProviderMockRecorder is the mock recorder for HelmProvider. -type HelmProviderMockRecorder struct { - mock *HelmProvider -} - -// NewHelmProvider creates a new mock instance. -func NewHelmProvider(ctrl *gomock.Controller) *HelmProvider { - mock := &HelmProvider{ctrl: ctrl} - mock.recorder = &HelmProviderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *HelmProvider) EXPECT() *HelmProviderMockRecorder { - return m.recorder -} - -// FetchIndex mocks base method. -func (m *HelmProvider) FetchIndex(arg0 context.Context, arg1 string, arg2 map[string][]string) (map[string]map[string]semver.Version, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FetchIndex", arg0, arg1, arg2) - ret0, _ := ret[0].(map[string]map[string]semver.Version) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FetchIndex indicates an expected call of FetchIndex. -func (mr *HelmProviderMockRecorder) FetchIndex(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchIndex", reflect.TypeOf((*HelmProvider)(nil).FetchIndex), arg0, arg1, arg2) -} - -// LatestVersions mocks base method. -func (m *HelmProvider) LatestVersions(arg0 context.Context, arg1, arg2 string, arg3 []string) (map[string]semver.Version, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestVersions", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(map[string]semver.Version) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestVersions indicates an expected call of LatestVersions. -func (mr *HelmProviderMockRecorder) LatestVersions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestVersions", reflect.TypeOf((*HelmProvider)(nil).LatestVersions), arg0, arg1, arg2, arg3) -} diff --git a/pkg/mocks/ketchup_service.go b/pkg/mocks/ketchup_service.go deleted file mode 100644 index 2b22a984..00000000 --- a/pkg/mocks/ketchup_service.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: KetchupService) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/ketchup/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// KetchupService is a mock of KetchupService interface. -type KetchupService struct { - ctrl *gomock.Controller - recorder *KetchupServiceMockRecorder -} - -// KetchupServiceMockRecorder is the mock recorder for KetchupService. -type KetchupServiceMockRecorder struct { - mock *KetchupService -} - -// NewKetchupService creates a new mock instance. -func NewKetchupService(ctrl *gomock.Controller) *KetchupService { - mock := &KetchupService{ctrl: ctrl} - mock.recorder = &KetchupServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *KetchupService) EXPECT() *KetchupServiceMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *KetchupService) Create(arg0 context.Context, arg1 model.Ketchup) (model.Ketchup, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *KetchupServiceMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*KetchupService)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *KetchupService) Delete(arg0 context.Context, arg1 model.Ketchup) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *KetchupServiceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*KetchupService)(nil).Delete), arg0, arg1) -} - -// List mocks base method. -func (m *KetchupService) List(arg0 context.Context, arg1 uint, arg2 string) ([]model.Ketchup, uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// List indicates an expected call of List. -func (mr *KetchupServiceMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*KetchupService)(nil).List), arg0, arg1, arg2) -} - -// ListForRepositories mocks base method. -func (m *KetchupService) ListForRepositories(arg0 context.Context, arg1 []model.Repository, arg2 ...model.KetchupFrequency) ([]model.Ketchup, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} - for _, a := range arg2 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListForRepositories", varargs...) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListForRepositories indicates an expected call of ListForRepositories. -func (mr *KetchupServiceMockRecorder) ListForRepositories(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListForRepositories", reflect.TypeOf((*KetchupService)(nil).ListForRepositories), varargs...) -} - -// ListOutdated mocks base method. -func (m *KetchupService) ListOutdated(arg0 context.Context, arg1 ...model.User) ([]model.Ketchup, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListOutdated", varargs...) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListOutdated indicates an expected call of ListOutdated. -func (mr *KetchupServiceMockRecorder) ListOutdated(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOutdated", reflect.TypeOf((*KetchupService)(nil).ListOutdated), varargs...) -} - -// Update mocks base method. -func (m *KetchupService) Update(arg0 context.Context, arg1 string, arg2 model.Ketchup) (model.Ketchup, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1, arg2) - ret0, _ := ret[0].(model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Update indicates an expected call of Update. -func (mr *KetchupServiceMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*KetchupService)(nil).Update), arg0, arg1, arg2) -} - -// UpdateAll mocks base method. -func (m *KetchupService) UpdateAll(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateAll", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateAll indicates an expected call of UpdateAll. -func (mr *KetchupServiceMockRecorder) UpdateAll(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAll", reflect.TypeOf((*KetchupService)(nil).UpdateAll), arg0) -} - -// UpdateVersion mocks base method. -func (m *KetchupService) UpdateVersion(arg0 context.Context, arg1, arg2 model.Identifier, arg3, arg4 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateVersion", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateVersion indicates an expected call of UpdateVersion. -func (mr *KetchupServiceMockRecorder) UpdateVersion(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVersion", reflect.TypeOf((*KetchupService)(nil).UpdateVersion), arg0, arg1, arg2, arg3, arg4) -} diff --git a/pkg/mocks/ketchup_store.go b/pkg/mocks/ketchup_store.go deleted file mode 100644 index d12edb27..00000000 --- a/pkg/mocks/ketchup_store.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: KetchupStore) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/ketchup/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// KetchupStore is a mock of KetchupStore interface. -type KetchupStore struct { - ctrl *gomock.Controller - recorder *KetchupStoreMockRecorder -} - -// KetchupStoreMockRecorder is the mock recorder for KetchupStore. -type KetchupStoreMockRecorder struct { - mock *KetchupStore -} - -// NewKetchupStore creates a new mock instance. -func NewKetchupStore(ctrl *gomock.Controller) *KetchupStore { - mock := &KetchupStore{ctrl: ctrl} - mock.recorder = &KetchupStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *KetchupStore) EXPECT() *KetchupStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *KetchupStore) Create(arg0 context.Context, arg1 model.Ketchup) (model.Identifier, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(model.Identifier) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *KetchupStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*KetchupStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *KetchupStore) Delete(arg0 context.Context, arg1 model.Ketchup) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *KetchupStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*KetchupStore)(nil).Delete), arg0, arg1) -} - -// DoAtomic mocks base method. -func (m *KetchupStore) DoAtomic(arg0 context.Context, arg1 func(context.Context) error) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DoAtomic", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// DoAtomic indicates an expected call of DoAtomic. -func (mr *KetchupStoreMockRecorder) DoAtomic(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DoAtomic", reflect.TypeOf((*KetchupStore)(nil).DoAtomic), arg0, arg1) -} - -// GetByRepository mocks base method. -func (m *KetchupStore) GetByRepository(arg0 context.Context, arg1 model.Identifier, arg2 string, arg3 bool) (model.Ketchup, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetByRepository", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetByRepository indicates an expected call of GetByRepository. -func (mr *KetchupStoreMockRecorder) GetByRepository(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByRepository", reflect.TypeOf((*KetchupStore)(nil).GetByRepository), arg0, arg1, arg2, arg3) -} - -// List mocks base method. -func (m *KetchupStore) List(arg0 context.Context, arg1 uint, arg2 string) ([]model.Ketchup, uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// List indicates an expected call of List. -func (mr *KetchupStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*KetchupStore)(nil).List), arg0, arg1, arg2) -} - -// ListByRepositoriesIDAndFrequencies mocks base method. -func (m *KetchupStore) ListByRepositoriesIDAndFrequencies(arg0 context.Context, arg1 []model.Identifier, arg2 ...model.KetchupFrequency) ([]model.Ketchup, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} - for _, a := range arg2 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListByRepositoriesIDAndFrequencies", varargs...) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListByRepositoriesIDAndFrequencies indicates an expected call of ListByRepositoriesIDAndFrequencies. -func (mr *KetchupStoreMockRecorder) ListByRepositoriesIDAndFrequencies(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByRepositoriesIDAndFrequencies", reflect.TypeOf((*KetchupStore)(nil).ListByRepositoriesIDAndFrequencies), varargs...) -} - -// ListOutdated mocks base method. -func (m *KetchupStore) ListOutdated(arg0 context.Context, arg1 ...model.Identifier) ([]model.Ketchup, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListOutdated", varargs...) - ret0, _ := ret[0].([]model.Ketchup) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListOutdated indicates an expected call of ListOutdated. -func (mr *KetchupStoreMockRecorder) ListOutdated(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOutdated", reflect.TypeOf((*KetchupStore)(nil).ListOutdated), varargs...) -} - -// Update mocks base method. -func (m *KetchupStore) Update(arg0 context.Context, arg1 model.Ketchup, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *KetchupStoreMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*KetchupStore)(nil).Update), arg0, arg1, arg2) -} - -// UpdateAll mocks base method. -func (m *KetchupStore) UpdateAll(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateAll", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateAll indicates an expected call of UpdateAll. -func (mr *KetchupStoreMockRecorder) UpdateAll(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAll", reflect.TypeOf((*KetchupStore)(nil).UpdateAll), arg0) -} - -// UpdateVersion mocks base method. -func (m *KetchupStore) UpdateVersion(arg0 context.Context, arg1, arg2 model.Identifier, arg3, arg4 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateVersion", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateVersion indicates an expected call of UpdateVersion. -func (mr *KetchupStoreMockRecorder) UpdateVersion(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVersion", reflect.TypeOf((*KetchupStore)(nil).UpdateVersion), arg0, arg1, arg2, arg3, arg4) -} diff --git a/pkg/mocks/mailer.go b/pkg/mocks/mailer.go deleted file mode 100644 index 47bb09aa..00000000 --- a/pkg/mocks/mailer.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: Mailer) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/mailer/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// Mailer is a mock of Mailer interface. -type Mailer struct { - ctrl *gomock.Controller - recorder *MailerMockRecorder -} - -// MailerMockRecorder is the mock recorder for Mailer. -type MailerMockRecorder struct { - mock *Mailer -} - -// NewMailer creates a new mock instance. -func NewMailer(ctrl *gomock.Controller) *Mailer { - mock := &Mailer{ctrl: ctrl} - mock.recorder = &MailerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *Mailer) EXPECT() *MailerMockRecorder { - return m.recorder -} - -// Enabled mocks base method. -func (m *Mailer) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MailerMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*Mailer)(nil).Enabled)) -} - -// Send mocks base method. -func (m *Mailer) Send(arg0 context.Context, arg1 model.MailRequest) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Send", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Send indicates an expected call of Send. -func (mr *MailerMockRecorder) Send(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*Mailer)(nil).Send), arg0, arg1) -} diff --git a/pkg/mocks/repository_service.go b/pkg/mocks/repository_service.go deleted file mode 100644 index f01d64ce..00000000 --- a/pkg/mocks/repository_service.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: RepositoryService) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/ketchup/pkg/model" - semver "github.com/ViBiOh/ketchup/pkg/semver" - gomock "github.com/golang/mock/gomock" -) - -// RepositoryService is a mock of RepositoryService interface. -type RepositoryService struct { - ctrl *gomock.Controller - recorder *RepositoryServiceMockRecorder -} - -// RepositoryServiceMockRecorder is the mock recorder for RepositoryService. -type RepositoryServiceMockRecorder struct { - mock *RepositoryService -} - -// NewRepositoryService creates a new mock instance. -func NewRepositoryService(ctrl *gomock.Controller) *RepositoryService { - mock := &RepositoryService{ctrl: ctrl} - mock.recorder = &RepositoryServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *RepositoryService) EXPECT() *RepositoryServiceMockRecorder { - return m.recorder -} - -// Clean mocks base method. -func (m *RepositoryService) Clean(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Clean", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Clean indicates an expected call of Clean. -func (mr *RepositoryServiceMockRecorder) Clean(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clean", reflect.TypeOf((*RepositoryService)(nil).Clean), arg0) -} - -// GetOrCreate mocks base method. -func (m *RepositoryService) GetOrCreate(arg0 context.Context, arg1 model.RepositoryKind, arg2, arg3, arg4 string) (model.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOrCreate", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(model.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOrCreate indicates an expected call of GetOrCreate. -func (mr *RepositoryServiceMockRecorder) GetOrCreate(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreate", reflect.TypeOf((*RepositoryService)(nil).GetOrCreate), arg0, arg1, arg2, arg3, arg4) -} - -// LatestVersions mocks base method. -func (m *RepositoryService) LatestVersions(arg0 context.Context, arg1 model.Repository) (map[string]semver.Version, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestVersions", arg0, arg1) - ret0, _ := ret[0].(map[string]semver.Version) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestVersions indicates an expected call of LatestVersions. -func (mr *RepositoryServiceMockRecorder) LatestVersions(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestVersions", reflect.TypeOf((*RepositoryService)(nil).LatestVersions), arg0, arg1) -} - -// List mocks base method. -func (m *RepositoryService) List(arg0 context.Context, arg1 uint, arg2 string) ([]model.Repository, uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// List indicates an expected call of List. -func (mr *RepositoryServiceMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*RepositoryService)(nil).List), arg0, arg1, arg2) -} - -// ListByKinds mocks base method. -func (m *RepositoryService) ListByKinds(arg0 context.Context, arg1 uint, arg2 string, arg3 ...model.RepositoryKind) ([]model.Repository, uint64, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} - for _, a := range arg3 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListByKinds", varargs...) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ListByKinds indicates an expected call of ListByKinds. -func (mr *RepositoryServiceMockRecorder) ListByKinds(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByKinds", reflect.TypeOf((*RepositoryService)(nil).ListByKinds), varargs...) -} - -// Suggest mocks base method. -func (m *RepositoryService) Suggest(arg0 context.Context, arg1 []model.Identifier, arg2 uint64) ([]model.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Suggest", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Suggest indicates an expected call of Suggest. -func (mr *RepositoryServiceMockRecorder) Suggest(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Suggest", reflect.TypeOf((*RepositoryService)(nil).Suggest), arg0, arg1, arg2) -} - -// Update mocks base method. -func (m *RepositoryService) Update(arg0 context.Context, arg1 model.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *RepositoryServiceMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*RepositoryService)(nil).Update), arg0, arg1) -} diff --git a/pkg/mocks/repository_store.go b/pkg/mocks/repository_store.go deleted file mode 100644 index 057d890f..00000000 --- a/pkg/mocks/repository_store.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: RepositoryStore) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/ketchup/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// RepositoryStore is a mock of RepositoryStore interface. -type RepositoryStore struct { - ctrl *gomock.Controller - recorder *RepositoryStoreMockRecorder -} - -// RepositoryStoreMockRecorder is the mock recorder for RepositoryStore. -type RepositoryStoreMockRecorder struct { - mock *RepositoryStore -} - -// NewRepositoryStore creates a new mock instance. -func NewRepositoryStore(ctrl *gomock.Controller) *RepositoryStore { - mock := &RepositoryStore{ctrl: ctrl} - mock.recorder = &RepositoryStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *RepositoryStore) EXPECT() *RepositoryStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *RepositoryStore) Create(arg0 context.Context, arg1 model.Repository) (model.Identifier, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(model.Identifier) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *RepositoryStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*RepositoryStore)(nil).Create), arg0, arg1) -} - -// DeleteUnused mocks base method. -func (m *RepositoryStore) DeleteUnused(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteUnused", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteUnused indicates an expected call of DeleteUnused. -func (mr *RepositoryStoreMockRecorder) DeleteUnused(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUnused", reflect.TypeOf((*RepositoryStore)(nil).DeleteUnused), arg0) -} - -// DeleteUnusedVersions mocks base method. -func (m *RepositoryStore) DeleteUnusedVersions(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteUnusedVersions", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteUnusedVersions indicates an expected call of DeleteUnusedVersions. -func (mr *RepositoryStoreMockRecorder) DeleteUnusedVersions(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUnusedVersions", reflect.TypeOf((*RepositoryStore)(nil).DeleteUnusedVersions), arg0) -} - -// DoAtomic mocks base method. -func (m *RepositoryStore) DoAtomic(arg0 context.Context, arg1 func(context.Context) error) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DoAtomic", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// DoAtomic indicates an expected call of DoAtomic. -func (mr *RepositoryStoreMockRecorder) DoAtomic(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DoAtomic", reflect.TypeOf((*RepositoryStore)(nil).DoAtomic), arg0, arg1) -} - -// Get mocks base method. -func (m *RepositoryStore) Get(arg0 context.Context, arg1 model.Identifier, arg2 bool) (model.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2) - ret0, _ := ret[0].(model.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get. -func (mr *RepositoryStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*RepositoryStore)(nil).Get), arg0, arg1, arg2) -} - -// GetByName mocks base method. -func (m *RepositoryStore) GetByName(arg0 context.Context, arg1 model.RepositoryKind, arg2, arg3 string) (model.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetByName", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(model.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetByName indicates an expected call of GetByName. -func (mr *RepositoryStoreMockRecorder) GetByName(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByName", reflect.TypeOf((*RepositoryStore)(nil).GetByName), arg0, arg1, arg2, arg3) -} - -// List mocks base method. -func (m *RepositoryStore) List(arg0 context.Context, arg1 uint, arg2 string) ([]model.Repository, uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// List indicates an expected call of List. -func (mr *RepositoryStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*RepositoryStore)(nil).List), arg0, arg1, arg2) -} - -// ListByKinds mocks base method. -func (m *RepositoryStore) ListByKinds(arg0 context.Context, arg1 uint, arg2 string, arg3 ...model.RepositoryKind) ([]model.Repository, uint64, error) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} - for _, a := range arg3 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ListByKinds", varargs...) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ListByKinds indicates an expected call of ListByKinds. -func (mr *RepositoryStoreMockRecorder) ListByKinds(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByKinds", reflect.TypeOf((*RepositoryStore)(nil).ListByKinds), varargs...) -} - -// Suggest mocks base method. -func (m *RepositoryStore) Suggest(arg0 context.Context, arg1 []model.Identifier, arg2 uint64) ([]model.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Suggest", arg0, arg1, arg2) - ret0, _ := ret[0].([]model.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Suggest indicates an expected call of Suggest. -func (mr *RepositoryStoreMockRecorder) Suggest(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Suggest", reflect.TypeOf((*RepositoryStore)(nil).Suggest), arg0, arg1, arg2) -} - -// UpdateVersions mocks base method. -func (m *RepositoryStore) UpdateVersions(arg0 context.Context, arg1 model.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateVersions", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateVersions indicates an expected call of UpdateVersions. -func (mr *RepositoryStoreMockRecorder) UpdateVersions(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVersions", reflect.TypeOf((*RepositoryStore)(nil).UpdateVersions), arg0, arg1) -} diff --git a/pkg/mocks/user_service.go b/pkg/mocks/user_service.go deleted file mode 100644 index b53e9a1c..00000000 --- a/pkg/mocks/user_service.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: UserService) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" -) - -// UserService is a mock of UserService interface. -type UserService struct { - ctrl *gomock.Controller - recorder *UserServiceMockRecorder -} - -// UserServiceMockRecorder is the mock recorder for UserService. -type UserServiceMockRecorder struct { - mock *UserService -} - -// NewUserService creates a new mock instance. -func NewUserService(ctrl *gomock.Controller) *UserService { - mock := &UserService{ctrl: ctrl} - mock.recorder = &UserServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *UserService) EXPECT() *UserServiceMockRecorder { - return m.recorder -} - -// StoreInContext mocks base method. -func (m *UserService) StoreInContext(arg0 context.Context) context.Context { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StoreInContext", arg0) - ret0, _ := ret[0].(context.Context) - return ret0 -} - -// StoreInContext indicates an expected call of StoreInContext. -func (mr *UserServiceMockRecorder) StoreInContext(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreInContext", reflect.TypeOf((*UserService)(nil).StoreInContext), arg0) -} diff --git a/pkg/mocks/user_store.go b/pkg/mocks/user_store.go deleted file mode 100644 index fbc6c176..00000000 --- a/pkg/mocks/user_store.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ViBiOh/ketchup/pkg/model (interfaces: UserStore) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - model "github.com/ViBiOh/ketchup/pkg/model" - gomock "github.com/golang/mock/gomock" -) - -// UserStore is a mock of UserStore interface. -type UserStore struct { - ctrl *gomock.Controller - recorder *UserStoreMockRecorder -} - -// UserStoreMockRecorder is the mock recorder for UserStore. -type UserStoreMockRecorder struct { - mock *UserStore -} - -// NewUserStore creates a new mock instance. -func NewUserStore(ctrl *gomock.Controller) *UserStore { - mock := &UserStore{ctrl: ctrl} - mock.recorder = &UserStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *UserStore) EXPECT() *UserStoreMockRecorder { - return m.recorder -} - -// Count mocks base method. -func (m *UserStore) Count(arg0 context.Context) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Count", arg0) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Count indicates an expected call of Count. -func (mr *UserStoreMockRecorder) Count(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*UserStore)(nil).Count), arg0) -} - -// Create mocks base method. -func (m *UserStore) Create(arg0 context.Context, arg1 model.User) (model.Identifier, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(model.Identifier) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *UserStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*UserStore)(nil).Create), arg0, arg1) -} - -// DoAtomic mocks base method. -func (m *UserStore) DoAtomic(arg0 context.Context, arg1 func(context.Context) error) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DoAtomic", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// DoAtomic indicates an expected call of DoAtomic. -func (mr *UserStoreMockRecorder) DoAtomic(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DoAtomic", reflect.TypeOf((*UserStore)(nil).DoAtomic), arg0, arg1) -} - -// GetByEmail mocks base method. -func (m *UserStore) GetByEmail(arg0 context.Context, arg1 string) (model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetByEmail", arg0, arg1) - ret0, _ := ret[0].(model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetByEmail indicates an expected call of GetByEmail. -func (mr *UserStoreMockRecorder) GetByEmail(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByEmail", reflect.TypeOf((*UserStore)(nil).GetByEmail), arg0, arg1) -} - -// GetByLoginID mocks base method. -func (m *UserStore) GetByLoginID(arg0 context.Context, arg1 uint64) (model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetByLoginID", arg0, arg1) - ret0, _ := ret[0].(model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetByLoginID indicates an expected call of GetByLoginID. -func (mr *UserStoreMockRecorder) GetByLoginID(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByLoginID", reflect.TypeOf((*UserStore)(nil).GetByLoginID), arg0, arg1) -} - -// ListReminderUsers mocks base method. -func (m *UserStore) ListReminderUsers(arg0 context.Context) ([]model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListReminderUsers", arg0) - ret0, _ := ret[0].([]model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListReminderUsers indicates an expected call of ListReminderUsers. -func (mr *UserStoreMockRecorder) ListReminderUsers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListReminderUsers", reflect.TypeOf((*UserStore)(nil).ListReminderUsers), arg0) -} diff --git a/pkg/model/database.go b/pkg/model/database.go index 702c5339..0ff42da3 100644 --- a/pkg/model/database.go +++ b/pkg/model/database.go @@ -6,9 +6,9 @@ import ( "github.com/jackc/pgx/v4" ) +//go:generate mockgen -source database.go -destination ../mocks/database.go -mock_names Database=Database -package mocks + // Database interface needed -// -//go:generate mockgen -destination ../mocks/database.go -mock_names Database=Database -package mocks github.com/ViBiOh/ketchup/pkg/model Database type Database interface { List(context.Context, func(pgx.Rows) error, string, ...any) error Get(context.Context, func(pgx.Row) error, string, ...any) error diff --git a/pkg/model/interfaces.go b/pkg/model/interfaces.go index 9d9050a6..6c55e33f 100644 --- a/pkg/model/interfaces.go +++ b/pkg/model/interfaces.go @@ -14,32 +14,26 @@ func (i Identifier) IsZero() bool { return i == 0 } +//go:generate mockgen -source interfaces.go -destination ../mocks/interfaces.go -package mocks -mock_names Mailer=Mailer,AuthService=AuthService,UserService=UserService,UserStore=UserStore,GenericProvider=GenericProvider,HelmProvider=HelmProvider,RepositoryService=RepositoryService,RepositoryStore=RepositoryStore,KetchupService=KetchupService,KetchupStore=KetchupStore + // Mailer interface client -// -//go:generate mockgen -destination ../mocks/mailer.go -mock_names Mailer=Mailer -package mocks github.com/ViBiOh/ketchup/pkg/model Mailer type Mailer interface { Enabled() bool Send(context.Context, mailerModel.MailRequest) error } // AuthService defines interactions with underlying User provider -// -//go:generate mockgen -destination ../mocks/auth_service.go -mock_names AuthService=AuthService -package mocks github.com/ViBiOh/ketchup/pkg/model AuthService type AuthService interface { Create(context.Context, authModel.User) (authModel.User, error) Check(context.Context, authModel.User, authModel.User) error } // UserService for storing user in context -// -//go:generate mockgen -destination ../mocks/user_service.go -mock_names UserService=UserService -package mocks github.com/ViBiOh/ketchup/pkg/model UserService type UserService interface { StoreInContext(context.Context) context.Context } // UserStore defines interactions with User storage -// -//go:generate mockgen -destination ../mocks/user_store.go -mock_names UserStore=UserStore -package mocks github.com/ViBiOh/ketchup/pkg/model UserStore type UserStore interface { DoAtomic(context.Context, func(context.Context) error) error ListReminderUsers(ctx context.Context) ([]User, error) @@ -50,23 +44,17 @@ type UserStore interface { } // GenericProvider defines interactions with common providers -// -//go:generate mockgen -destination ../mocks/generic_provider.go -mock_names GenericProvider=GenericProvider -package mocks github.com/ViBiOh/ketchup/pkg/model GenericProvider type GenericProvider interface { LatestVersions(context.Context, string, []string) (map[string]semver.Version, error) } // HelmProvider defines interactions with helm -// -//go:generate mockgen -destination ../mocks/helm_provider.go -mock_names HelmProvider=HelmProvider -package mocks github.com/ViBiOh/ketchup/pkg/model HelmProvider type HelmProvider interface { FetchIndex(context.Context, string, map[string][]string) (map[string]map[string]semver.Version, error) LatestVersions(context.Context, string, string, []string) (map[string]semver.Version, error) } // RepositoryService defines interactions with repository -// -//go:generate mockgen -destination ../mocks/repository_service.go -mock_names RepositoryService=RepositoryService -package mocks github.com/ViBiOh/ketchup/pkg/model RepositoryService type RepositoryService interface { List(context.Context, uint, string) ([]Repository, uint64, error) ListByKinds(context.Context, uint, string, ...RepositoryKind) ([]Repository, uint64, error) @@ -78,8 +66,6 @@ type RepositoryService interface { } // RepositoryStore defines interactions with repository storage -// -//go:generate mockgen -destination ../mocks/repository_store.go -mock_names RepositoryStore=RepositoryStore -package mocks github.com/ViBiOh/ketchup/pkg/model RepositoryStore type RepositoryStore interface { DoAtomic(ctx context.Context, action func(context.Context) error) error List(ctx context.Context, pageSize uint, last string) ([]Repository, uint64, error) @@ -94,8 +80,6 @@ type RepositoryStore interface { } // KetchupService defines interactions with ketchup -// -//go:generate mockgen -destination ../mocks/ketchup_service.go -mock_names KetchupService=KetchupService -package mocks github.com/ViBiOh/ketchup/pkg/model KetchupService type KetchupService interface { List(ctx context.Context, pageSize uint, last string) ([]Ketchup, uint64, error) ListForRepositories(ctx context.Context, repositories []Repository, frequencies ...KetchupFrequency) ([]Ketchup, error) @@ -108,8 +92,6 @@ type KetchupService interface { } // KetchupStore defines interactions with ketchup storage -// -//go:generate mockgen -destination ../mocks/ketchup_store.go -mock_names KetchupStore=KetchupStore -package mocks github.com/ViBiOh/ketchup/pkg/model KetchupStore type KetchupStore interface { DoAtomic(ctx context.Context, action func(context.Context) error) error List(ctx context.Context, page uint, last string) ([]Ketchup, uint64, error)