diff --git a/dev/BUILD.bazel b/dev/BUILD.bazel index 8dac9432aa3..a75892c68ae 100644 --- a/dev/BUILD.bazel +++ b/dev/BUILD.bazel @@ -80,7 +80,6 @@ write_source_files( "//internal/codeintel/dependencies/internal/background:generate_mocks", "//internal/codeintel/policies:generate_mocks", "//internal/codeintel/ranking:generate_mocks", - "//internal/codeintel/uploads/internal/background/backfiller:generate_mocks", "//internal/codeintel/uploads/internal/background/expirer:generate_mocks", "//internal/codeintel/uploads/internal/background/processor:generate_mocks", "//internal/codeintel/uploads/transport/graphql:generate_mocks", @@ -130,5 +129,6 @@ write_source_files( "//internal/codeintel/codegraph/codegraphmocks:generate_mocks", "//internal/codeintel/codenav/internal/lsifstore/mocks:generate_mocks", "//cmd/frontend/internal/auth/userpasswd:generate_mocks", + "//internal/codeintel/uploads/internal/storemocks:generate_mocks", ], ) diff --git a/internal/codeintel/uploads/internal/background/backfiller/BUILD.bazel b/internal/codeintel/uploads/internal/background/backfiller/BUILD.bazel index e2b5542ac2b..b9ef9553e65 100644 --- a/internal/codeintel/uploads/internal/background/backfiller/BUILD.bazel +++ b/internal/codeintel/uploads/internal/background/backfiller/BUILD.bazel @@ -1,4 +1,3 @@ -load("//dev:go_mockgen.bzl", "go_mockgen") load("//dev:go_defs.bzl", "go_test") load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -25,35 +24,15 @@ go_library( go_test( name = "backfiller_test", - srcs = [ - "job_backfill_test.go", - "mocks_test.go", - ], + srcs = ["job_backfill_test.go"], embed = [":backfiller"], tags = [TAG_PLATFORM_GRAPH], deps = [ "//internal/api", - "//internal/codeintel/core", - "//internal/codeintel/uploads/internal/commitgraph", "//internal/codeintel/uploads/internal/store", - "//internal/codeintel/uploads/shared", - "//internal/database/basestore", + "//internal/codeintel/uploads/internal/storemocks", "//internal/gitserver", "//internal/gitserver/gitdomain", - "//internal/observation", - "//internal/workerutil/dbworker/store", - "//lib/codeintel/precise", "@com_github_google_go_cmp//cmp", ], ) - -go_mockgen( - name = "generate_mocks", - out = "mocks_test.go", - manifests = [ - "//:mockgen.yaml", - "//:mockgen.test.yaml", - "//:mockgen.temp.yaml", - ], - deps = ["//internal/codeintel/uploads/internal/store"], -) diff --git a/internal/codeintel/uploads/internal/background/backfiller/job_backfill_test.go b/internal/codeintel/uploads/internal/background/backfiller/job_backfill_test.go index bda9f0f7768..35254e000e9 100644 --- a/internal/codeintel/uploads/internal/background/backfiller/job_backfill_test.go +++ b/internal/codeintel/uploads/internal/background/backfiller/job_backfill_test.go @@ -10,13 +10,14 @@ import ( "github.com/sourcegraph/sourcegraph/internal/api" shared "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store" + "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/storemocks" "github.com/sourcegraph/sourcegraph/internal/gitserver" "github.com/sourcegraph/sourcegraph/internal/gitserver/gitdomain" ) func TestBackfillCommittedAtBatch(t *testing.T) { ctx := context.Background() - store := NewMockStore() + store := storemocks.NewMockStore() gitserverClient := gitserver.NewMockClient() svc := &backfiller{ store: store, @@ -72,7 +73,7 @@ func TestBackfillCommittedAtBatch(t *testing.T) { } committedAtByCommit := map[string]time.Time{} - history := store.UpdateCommittedAtFunc.history + history := store.UpdateCommittedAtFunc.History() for i := range n { if len(history) <= i { @@ -98,7 +99,7 @@ func TestBackfillCommittedAtBatch(t *testing.T) { func TestBackfillCommittedAtBatchUnknownCommits(t *testing.T) { ctx := context.Background() - store := NewMockStore() + store := storemocks.NewMockStore() gitserverClient := gitserver.NewMockClient() svc := &backfiller{ store: store, @@ -159,7 +160,7 @@ func TestBackfillCommittedAtBatchUnknownCommits(t *testing.T) { } committedAtByCommit := map[string]time.Time{} - history := store.UpdateCommittedAtFunc.history + history := store.UpdateCommittedAtFunc.History() for i := range n { if len(history) <= i { diff --git a/internal/codeintel/uploads/internal/background/expirer/BUILD.bazel b/internal/codeintel/uploads/internal/background/expirer/BUILD.bazel index 1e7a739e1b7..bf357faf5d1 100644 --- a/internal/codeintel/uploads/internal/background/expirer/BUILD.bazel +++ b/internal/codeintel/uploads/internal/background/expirer/BUILD.bazel @@ -42,22 +42,18 @@ go_test( tags = [TAG_PLATFORM_GRAPH], deps = [ "//internal/api", - "//internal/codeintel/core", "//internal/codeintel/policies", "//internal/codeintel/policies/shared", - "//internal/codeintel/uploads/internal/commitgraph", - "//internal/codeintel/uploads/internal/store", + "//internal/codeintel/uploads/internal/storemocks", "//internal/codeintel/uploads/shared", "//internal/database/basestore", "//internal/database/dbmocks", "//internal/executor", - "//internal/gitserver/gitdomain", "//internal/observation", "//internal/timeutil", "//internal/types", "//internal/workerutil", "//internal/workerutil/dbworker/store", - "//lib/codeintel/precise", "//lib/pointers", "@com_github_google_go_cmp//cmp", "@com_github_keegancsmith_sqlf//:sqlf", @@ -74,7 +70,6 @@ go_mockgen( ], deps = [ ":expirer", - "//internal/codeintel/uploads/internal/store", "//internal/workerutil/dbworker/store", ], ) diff --git a/internal/codeintel/uploads/internal/background/expirer/job_expirer_test.go b/internal/codeintel/uploads/internal/background/expirer/job_expirer_test.go index 97ca1f4a3a4..c4ad190eb14 100644 --- a/internal/codeintel/uploads/internal/background/expirer/job_expirer_test.go +++ b/internal/codeintel/uploads/internal/background/expirer/job_expirer_test.go @@ -12,6 +12,7 @@ import ( "github.com/sourcegraph/sourcegraph/internal/api" "github.com/sourcegraph/sourcegraph/internal/codeintel/policies" policiesshared "github.com/sourcegraph/sourcegraph/internal/codeintel/policies/shared" + "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/storemocks" "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared" uploadsshared "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared" "github.com/sourcegraph/sourcegraph/internal/database/dbmocks" @@ -116,7 +117,7 @@ func setupMockPolicyService() *MockPolicyService { return policySvc } -func setupMockUploadService(now time.Time) *MockStore { +func setupMockUploadService(now time.Time) *storemocks.MockStore { uploads := []shared.Upload{ {ID: 11, State: "completed", RepositoryID: 50, Commit: "deadbeef01", UploadedAt: daysAgo(now, 1)}, // repo 50 {ID: 12, State: "completed", RepositoryID: 50, Commit: "deadbeef02", UploadedAt: daysAgo(now, 2)}, @@ -211,7 +212,7 @@ func setupMockUploadService(now time.Time) *MockStore { return nil, nil, nil } - uploadSvc := NewMockStore() + uploadSvc := storemocks.NewMockStore() uploadSvc.SetRepositoriesForRetentionScanFunc.SetDefaultHook(setRepositoriesForRetentionScanFunc) uploadSvc.GetUploadsFunc.SetDefaultHook(getUploads) uploadSvc.UpdateUploadRetentionFunc.SetDefaultHook(updateUploadRetention) diff --git a/internal/codeintel/uploads/internal/background/expirer/mocks_test.go b/internal/codeintel/uploads/internal/background/expirer/mocks_test.go index 0b061d6b06b..955abefe60f 100644 --- a/internal/codeintel/uploads/internal/background/expirer/mocks_test.go +++ b/internal/codeintel/uploads/internal/background/expirer/mocks_test.go @@ -13,19 +13,12 @@ import ( sqlf "github.com/keegancsmith/sqlf" api "github.com/sourcegraph/sourcegraph/internal/api" - core "github.com/sourcegraph/sourcegraph/internal/codeintel/core" policies "github.com/sourcegraph/sourcegraph/internal/codeintel/policies" shared "github.com/sourcegraph/sourcegraph/internal/codeintel/policies/shared" - commitgraph "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/commitgraph" - store "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store" - shared1 "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared" basestore "github.com/sourcegraph/sourcegraph/internal/database/basestore" executor "github.com/sourcegraph/sourcegraph/internal/executor" - gitdomain "github.com/sourcegraph/sourcegraph/internal/gitserver/gitdomain" - observation "github.com/sourcegraph/sourcegraph/internal/observation" workerutil "github.com/sourcegraph/sourcegraph/internal/workerutil" - store1 "github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store" - precise "github.com/sourcegraph/sourcegraph/lib/codeintel/precise" + store "github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store" ) // MockPolicyMatcher is a mock implementation of the PolicyMatcher interface @@ -364,8212 +357,6 @@ func (c PolicyServiceGetConfigurationPoliciesFuncCall) Results() []interface{} { return []interface{}{c.Result0, c.Result1, c.Result2} } -// MockStore is a mock implementation of the Store interface (from the -// package -// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store) -// used for unit testing. -type MockStore struct { - // AddUploadPartFunc is an instance of a mock function object - // controlling the behavior of the method AddUploadPart. - AddUploadPartFunc *StoreAddUploadPartFunc - // DeleteAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method DeleteAutoIndexJobByID. - DeleteAutoIndexJobByIDFunc *StoreDeleteAutoIndexJobByIDFunc - // DeleteAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteAutoIndexJobs. - DeleteAutoIndexJobsFunc *StoreDeleteAutoIndexJobsFunc - // DeleteAutoIndexJobsWithoutRepositoryFunc is an instance of a mock - // function object controlling the behavior of the method - // DeleteAutoIndexJobsWithoutRepository. - DeleteAutoIndexJobsWithoutRepositoryFunc *StoreDeleteAutoIndexJobsWithoutRepositoryFunc - // DeleteOldAuditLogsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteOldAuditLogs. - DeleteOldAuditLogsFunc *StoreDeleteOldAuditLogsFunc - // DeleteOverlappingCompletedUploadsFunc is an instance of a mock - // function object controlling the behavior of the method - // DeleteOverlappingCompletedUploads. - DeleteOverlappingCompletedUploadsFunc *StoreDeleteOverlappingCompletedUploadsFunc - // DeleteUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method DeleteUploadByID. - DeleteUploadByIDFunc *StoreDeleteUploadByIDFunc - // DeleteUploadsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteUploads. - DeleteUploadsFunc *StoreDeleteUploadsFunc - // DeleteUploadsStuckUploadingFunc is an instance of a mock function - // object controlling the behavior of the method - // DeleteUploadsStuckUploading. - DeleteUploadsStuckUploadingFunc *StoreDeleteUploadsStuckUploadingFunc - // DeleteUploadsWithoutRepositoryFunc is an instance of a mock function - // object controlling the behavior of the method - // DeleteUploadsWithoutRepository. - DeleteUploadsWithoutRepositoryFunc *StoreDeleteUploadsWithoutRepositoryFunc - // ExpireFailedRecordsFunc is an instance of a mock function object - // controlling the behavior of the method ExpireFailedRecords. - ExpireFailedRecordsFunc *StoreExpireFailedRecordsFunc - // FindClosestCompletedUploadsFunc is an instance of a mock function - // object controlling the behavior of the method - // FindClosestCompletedUploads. - FindClosestCompletedUploadsFunc *StoreFindClosestCompletedUploadsFunc - // FindClosestCompletedUploadsFromGraphFragmentFunc is an instance of a - // mock function object controlling the behavior of the method - // FindClosestCompletedUploadsFromGraphFragment. - FindClosestCompletedUploadsFromGraphFragmentFunc *StoreFindClosestCompletedUploadsFromGraphFragmentFunc - // GetAuditLogsForUploadFunc is an instance of a mock function object - // controlling the behavior of the method GetAuditLogsForUpload. - GetAuditLogsForUploadFunc *StoreGetAuditLogsForUploadFunc - // GetAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobByID. - GetAutoIndexJobByIDFunc *StoreGetAutoIndexJobByIDFunc - // GetAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobs. - GetAutoIndexJobsFunc *StoreGetAutoIndexJobsFunc - // GetAutoIndexJobsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobsByIDs. - GetAutoIndexJobsByIDsFunc *StoreGetAutoIndexJobsByIDsFunc - // GetCommitAndDateForOldestUploadFunc is an instance of a mock function - // object controlling the behavior of the method - // GetCommitAndDateForOldestUpload. - GetCommitAndDateForOldestUploadFunc *StoreGetCommitAndDateForOldestUploadFunc - // GetCommitGraphMetadataFunc is an instance of a mock function object - // controlling the behavior of the method GetCommitGraphMetadata. - GetCommitGraphMetadataFunc *StoreGetCommitGraphMetadataFunc - // GetCommitsVisibleToUploadFunc is an instance of a mock function - // object controlling the behavior of the method - // GetCommitsVisibleToUpload. - GetCommitsVisibleToUploadFunc *StoreGetCommitsVisibleToUploadFunc - // GetCompletedUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetCompletedUploadsByIDs. - GetCompletedUploadsByIDsFunc *StoreGetCompletedUploadsByIDsFunc - // GetCompletedUploadsWithDefinitionsForMonikersFunc is an instance of a - // mock function object controlling the behavior of the method - // GetCompletedUploadsWithDefinitionsForMonikers. - GetCompletedUploadsWithDefinitionsForMonikersFunc *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc - // GetDirtyRepositoriesFunc is an instance of a mock function object - // controlling the behavior of the method GetDirtyRepositories. - GetDirtyRepositoriesFunc *StoreGetDirtyRepositoriesFunc - // GetIndexersFunc is an instance of a mock function object controlling - // the behavior of the method GetIndexers. - GetIndexersFunc *StoreGetIndexersFunc - // GetLastUploadRetentionScanForRepositoryFunc is an instance of a mock - // function object controlling the behavior of the method - // GetLastUploadRetentionScanForRepository. - GetLastUploadRetentionScanForRepositoryFunc *StoreGetLastUploadRetentionScanForRepositoryFunc - // GetRecentAutoIndexJobsSummaryFunc is an instance of a mock function - // object controlling the behavior of the method - // GetRecentAutoIndexJobsSummary. - GetRecentAutoIndexJobsSummaryFunc *StoreGetRecentAutoIndexJobsSummaryFunc - // GetRecentUploadsSummaryFunc is an instance of a mock function object - // controlling the behavior of the method GetRecentUploadsSummary. - GetRecentUploadsSummaryFunc *StoreGetRecentUploadsSummaryFunc - // GetRepositoriesMaxStaleAgeFunc is an instance of a mock function - // object controlling the behavior of the method - // GetRepositoriesMaxStaleAge. - GetRepositoriesMaxStaleAgeFunc *StoreGetRepositoriesMaxStaleAgeFunc - // GetUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method GetUploadByID. - GetUploadByIDFunc *StoreGetUploadByIDFunc - // GetUploadIDsWithReferencesFunc is an instance of a mock function - // object controlling the behavior of the method - // GetUploadIDsWithReferences. - GetUploadIDsWithReferencesFunc *StoreGetUploadIDsWithReferencesFunc - // GetUploadsFunc is an instance of a mock function object controlling - // the behavior of the method GetUploads. - GetUploadsFunc *StoreGetUploadsFunc - // GetUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetUploadsByIDs. - GetUploadsByIDsFunc *StoreGetUploadsByIDsFunc - // GetUploadsByIDsAllowDeletedFunc is an instance of a mock function - // object controlling the behavior of the method - // GetUploadsByIDsAllowDeleted. - GetUploadsByIDsAllowDeletedFunc *StoreGetUploadsByIDsAllowDeletedFunc - // GetVisibleUploadsMatchingMonikersFunc is an instance of a mock - // function object controlling the behavior of the method - // GetVisibleUploadsMatchingMonikers. - GetVisibleUploadsMatchingMonikersFunc *StoreGetVisibleUploadsMatchingMonikersFunc - // HandleFunc is an instance of a mock function object controlling the - // behavior of the method Handle. - HandleFunc *StoreHandleFunc - // HardDeleteUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method HardDeleteUploadsByIDs. - HardDeleteUploadsByIDsFunc *StoreHardDeleteUploadsByIDsFunc - // HasCommitFunc is an instance of a mock function object controlling - // the behavior of the method HasCommit. - HasCommitFunc *StoreHasCommitFunc - // HasRepositoryFunc is an instance of a mock function object - // controlling the behavior of the method HasRepository. - HasRepositoryFunc *StoreHasRepositoryFunc - // InsertDependencySyncingJobFunc is an instance of a mock function - // object controlling the behavior of the method - // InsertDependencySyncingJob. - InsertDependencySyncingJobFunc *StoreInsertDependencySyncingJobFunc - // InsertUploadFunc is an instance of a mock function object controlling - // the behavior of the method InsertUpload. - InsertUploadFunc *StoreInsertUploadFunc - // MarkFailedFunc is an instance of a mock function object controlling - // the behavior of the method MarkFailed. - MarkFailedFunc *StoreMarkFailedFunc - // MarkQueuedFunc is an instance of a mock function object controlling - // the behavior of the method MarkQueued. - MarkQueuedFunc *StoreMarkQueuedFunc - // NumRepositoriesWithCodeIntelligenceFunc is an instance of a mock - // function object controlling the behavior of the method - // NumRepositoriesWithCodeIntelligence. - NumRepositoriesWithCodeIntelligenceFunc *StoreNumRepositoriesWithCodeIntelligenceFunc - // ProcessSourcedCommitsFunc is an instance of a mock function object - // controlling the behavior of the method ProcessSourcedCommits. - ProcessSourcedCommitsFunc *StoreProcessSourcedCommitsFunc - // ProcessStaleSourcedCommitsFunc is an instance of a mock function - // object controlling the behavior of the method - // ProcessStaleSourcedCommits. - ProcessStaleSourcedCommitsFunc *StoreProcessStaleSourcedCommitsFunc - // ReconcileCandidatesFunc is an instance of a mock function object - // controlling the behavior of the method ReconcileCandidates. - ReconcileCandidatesFunc *StoreReconcileCandidatesFunc - // ReferencesForUploadFunc is an instance of a mock function object - // controlling the behavior of the method ReferencesForUpload. - ReferencesForUploadFunc *StoreReferencesForUploadFunc - // ReindexUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method ReindexUploadByID. - ReindexUploadByIDFunc *StoreReindexUploadByIDFunc - // ReindexUploadsFunc is an instance of a mock function object - // controlling the behavior of the method ReindexUploads. - ReindexUploadsFunc *StoreReindexUploadsFunc - // RepositoryIDsWithErrorsFunc is an instance of a mock function object - // controlling the behavior of the method RepositoryIDsWithErrors. - RepositoryIDsWithErrorsFunc *StoreRepositoryIDsWithErrorsFunc - // SetRepositoriesForRetentionScanFunc is an instance of a mock function - // object controlling the behavior of the method - // SetRepositoriesForRetentionScan. - SetRepositoriesForRetentionScanFunc *StoreSetRepositoriesForRetentionScanFunc - // SetRepositoryAsDirtyFunc is an instance of a mock function object - // controlling the behavior of the method SetRepositoryAsDirty. - SetRepositoryAsDirtyFunc *StoreSetRepositoryAsDirtyFunc - // SetRerunAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method SetRerunAutoIndexJobByID. - SetRerunAutoIndexJobByIDFunc *StoreSetRerunAutoIndexJobByIDFunc - // SetRerunAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method SetRerunAutoIndexJobs. - SetRerunAutoIndexJobsFunc *StoreSetRerunAutoIndexJobsFunc - // SoftDeleteExpiredUploadsFunc is an instance of a mock function object - // controlling the behavior of the method SoftDeleteExpiredUploads. - SoftDeleteExpiredUploadsFunc *StoreSoftDeleteExpiredUploadsFunc - // SoftDeleteExpiredUploadsViaTraversalFunc is an instance of a mock - // function object controlling the behavior of the method - // SoftDeleteExpiredUploadsViaTraversal. - SoftDeleteExpiredUploadsViaTraversalFunc *StoreSoftDeleteExpiredUploadsViaTraversalFunc - // SourcedCommitsWithoutCommittedAtFunc is an instance of a mock - // function object controlling the behavior of the method - // SourcedCommitsWithoutCommittedAt. - SourcedCommitsWithoutCommittedAtFunc *StoreSourcedCommitsWithoutCommittedAtFunc - // UpdateCommittedAtFunc is an instance of a mock function object - // controlling the behavior of the method UpdateCommittedAt. - UpdateCommittedAtFunc *StoreUpdateCommittedAtFunc - // UpdatePackageReferencesFunc is an instance of a mock function object - // controlling the behavior of the method UpdatePackageReferences. - UpdatePackageReferencesFunc *StoreUpdatePackageReferencesFunc - // UpdatePackagesFunc is an instance of a mock function object - // controlling the behavior of the method UpdatePackages. - UpdatePackagesFunc *StoreUpdatePackagesFunc - // UpdateUploadRetentionFunc is an instance of a mock function object - // controlling the behavior of the method UpdateUploadRetention. - UpdateUploadRetentionFunc *StoreUpdateUploadRetentionFunc - // UpdateUploadsVisibleToCommitsFunc is an instance of a mock function - // object controlling the behavior of the method - // UpdateUploadsVisibleToCommits. - UpdateUploadsVisibleToCommitsFunc *StoreUpdateUploadsVisibleToCommitsFunc - // WithTransactionFunc is an instance of a mock function object - // controlling the behavior of the method WithTransaction. - WithTransactionFunc *StoreWithTransactionFunc - // WorkerutilStoreFunc is an instance of a mock function object - // controlling the behavior of the method WorkerutilStore. - WorkerutilStoreFunc *StoreWorkerutilStoreFunc -} - -// NewMockStore creates a new mock of the Store interface. All methods -// return zero values for all results, unless overwritten. -func NewMockStore() *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: func(context.Context, int, int) (r0 error) { - return - }, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 error) { - return - }, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.DeleteAutoIndexJobsOptions) (r0 error) { - return - }, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: func(context.Context, time.Duration, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: func(context.Context, int, string, string, string) (r0 error) { - return - }, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 error) { - return - }, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: func(context.Context, shared1.DeleteUploadsOptions) (r0 error) { - return - }, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: func(context.Context, int, time.Duration, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: func(context.Context, shared1.UploadMatchingOptions) (r0 []shared1.CompletedUpload, r1 error) { - return - }, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) (r0 []shared1.CompletedUpload, r1 error) { - return - }, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: func(context.Context, int) (r0 []shared1.UploadLog, r1 error) { - return - }, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 shared1.AutoIndexJob, r1 bool, r2 error) { - return - }, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.GetAutoIndexJobsOptions) (r0 []shared1.AutoIndexJob, r1 int, r2 error) { - return - }, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared1.AutoIndexJob, r1 error) { - return - }, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: func(context.Context, int) (r0 core.Option[store.CommitWithDate], r1 error) { - return - }, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 *time.Time, r2 error) { - return - }, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: func(context.Context, int, int, *string) (r0 []string, r1 *string, r2 error) { - return - }, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: func(context.Context, []int) (r0 []shared1.CompletedUpload, r1 error) { - return - }, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData) (r0 []shared1.CompletedUpload, r1 error) { - return - }, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: func(context.Context) (r0 []shared1.DirtyRepository, r1 error) { - return - }, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: func(context.Context, shared1.GetIndexersOptions) (r0 []string, r1 error) { - return - }, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: func(context.Context, int) (r0 *time.Time, r1 error) { - return - }, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: func(context.Context, int) (r0 []shared1.GroupedAutoIndexJobs, r1 error) { - return - }, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: func(context.Context, int) (r0 []shared1.UploadsWithRepositoryNamespace, r1 error) { - return - }, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: func(context.Context) (r0 time.Duration, r1 error) { - return - }, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 shared1.Upload, r1 bool, r2 error) { - return - }, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) (r0 []int, r1 int, r2 int, r3 error) { - return - }, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: func(context.Context, shared1.GetUploadsOptions) (r0 []shared1.Upload, r1 int, r2 error) { - return - }, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared1.Upload, r1 error) { - return - }, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared1.Upload, r1 error) { - return - }, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (r0 shared1.PackageReferenceScanner, r1 int, r2 error) { - return - }, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: func() (r0 *basestore.Store) { - return - }, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 error) { - return - }, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: func(context.Context, api.RepoID, api.CommitID) (r0 bool, r1 error) { - return - }, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: func(context.Context, api.RepoID) (r0 bool, r1 error) { - return - }, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 error) { - return - }, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: func(context.Context, shared1.Upload) (r0 int, r1 error) { - return - }, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: func(context.Context, int, string) (r0 error) { - return - }, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: func(context.Context, int, *int64) (r0 error) { - return - }, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: func(context.Context) (r0 int, r1 error) { - return - }, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (r0 int, r1 int, r2 error) { - return - }, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: func(context.Context, int) (r0 []int, r1 error) { - return - }, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: func(context.Context, int) (r0 shared1.PackageReferenceScanner, r1 error) { - return - }, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: func(context.Context, shared1.ReindexUploadsOptions) (r0 error) { - return - }, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: func(context.Context, int, int) (r0 []shared1.RepositoryWithCount, r1 int, r2 error) { - return - }, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: func(context.Context, time.Duration, int) (r0 []int, r1 error) { - return - }, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.SetRerunAutoIndexJobsOptions) (r0 error) { - return - }, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 int, r2 error) { - return - }, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 int, r2 error) { - return - }, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: func(context.Context, int) (r0 []store.SourcedCommits, r1 error) { - return - }, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: func(context.Context, int, string, string) (r0 error) { - return - }, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: func(context.Context, int, []precise.PackageReference) (r0 error) { - return - }, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: func(context.Context, int, []precise.Package) (r0 error) { - return - }, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: func(context.Context, []int, []int) (r0 error) { - return - }, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) (r0 error) { - return - }, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: func(context.Context, func(s store.Store) error) (r0 error) { - return - }, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: func(*observation.Context) (r0 store1.Store[shared1.Upload]) { - return - }, - }, - } -} - -// NewStrictMockStore creates a new mock of the Store interface. All methods -// panic on invocation, unless overwritten. -func NewStrictMockStore() *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: func(context.Context, int, int) error { - panic("unexpected invocation of MockStore.AddUploadPart") - }, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (bool, error) { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobByID") - }, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.DeleteAutoIndexJobsOptions) error { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobs") - }, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobsWithoutRepository") - }, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: func(context.Context, time.Duration, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteOldAuditLogs") - }, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: func(context.Context, int, string, string, string) error { - panic("unexpected invocation of MockStore.DeleteOverlappingCompletedUploads") - }, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: func(context.Context, int) (bool, error) { - panic("unexpected invocation of MockStore.DeleteUploadByID") - }, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: func(context.Context, shared1.DeleteUploadsOptions) error { - panic("unexpected invocation of MockStore.DeleteUploads") - }, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteUploadsStuckUploading") - }, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteUploadsWithoutRepository") - }, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: func(context.Context, int, time.Duration, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.ExpireFailedRecords") - }, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) { - panic("unexpected invocation of MockStore.FindClosestCompletedUploads") - }, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) { - panic("unexpected invocation of MockStore.FindClosestCompletedUploadsFromGraphFragment") - }, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: func(context.Context, int) ([]shared1.UploadLog, error) { - panic("unexpected invocation of MockStore.GetAuditLogsForUpload") - }, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (shared1.AutoIndexJob, bool, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobByID") - }, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobs") - }, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: func(context.Context, ...int) ([]shared1.AutoIndexJob, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobsByIDs") - }, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: func(context.Context, int) (core.Option[store.CommitWithDate], error) { - panic("unexpected invocation of MockStore.GetCommitAndDateForOldestUpload") - }, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: func(context.Context, int) (bool, *time.Time, error) { - panic("unexpected invocation of MockStore.GetCommitGraphMetadata") - }, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: func(context.Context, int, int, *string) ([]string, *string, error) { - panic("unexpected invocation of MockStore.GetCommitsVisibleToUpload") - }, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: func(context.Context, []int) ([]shared1.CompletedUpload, error) { - panic("unexpected invocation of MockStore.GetCompletedUploadsByIDs") - }, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) { - panic("unexpected invocation of MockStore.GetCompletedUploadsWithDefinitionsForMonikers") - }, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: func(context.Context) ([]shared1.DirtyRepository, error) { - panic("unexpected invocation of MockStore.GetDirtyRepositories") - }, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: func(context.Context, shared1.GetIndexersOptions) ([]string, error) { - panic("unexpected invocation of MockStore.GetIndexers") - }, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: func(context.Context, int) (*time.Time, error) { - panic("unexpected invocation of MockStore.GetLastUploadRetentionScanForRepository") - }, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) { - panic("unexpected invocation of MockStore.GetRecentAutoIndexJobsSummary") - }, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) { - panic("unexpected invocation of MockStore.GetRecentUploadsSummary") - }, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: func(context.Context) (time.Duration, error) { - panic("unexpected invocation of MockStore.GetRepositoriesMaxStaleAge") - }, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: func(context.Context, int) (shared1.Upload, bool, error) { - panic("unexpected invocation of MockStore.GetUploadByID") - }, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - panic("unexpected invocation of MockStore.GetUploadIDsWithReferences") - }, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) { - panic("unexpected invocation of MockStore.GetUploads") - }, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) ([]shared1.Upload, error) { - panic("unexpected invocation of MockStore.GetUploadsByIDs") - }, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: func(context.Context, ...int) ([]shared1.Upload, error) { - panic("unexpected invocation of MockStore.GetUploadsByIDsAllowDeleted") - }, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) { - panic("unexpected invocation of MockStore.GetVisibleUploadsMatchingMonikers") - }, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: func() *basestore.Store { - panic("unexpected invocation of MockStore.Handle") - }, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) error { - panic("unexpected invocation of MockStore.HardDeleteUploadsByIDs") - }, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: func(context.Context, api.RepoID, api.CommitID) (bool, error) { - panic("unexpected invocation of MockStore.HasCommit") - }, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: func(context.Context, api.RepoID) (bool, error) { - panic("unexpected invocation of MockStore.HasRepository") - }, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: func(context.Context, int) (int, error) { - panic("unexpected invocation of MockStore.InsertDependencySyncingJob") - }, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: func(context.Context, shared1.Upload) (int, error) { - panic("unexpected invocation of MockStore.InsertUpload") - }, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: func(context.Context, int, string) error { - panic("unexpected invocation of MockStore.MarkFailed") - }, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: func(context.Context, int, *int64) error { - panic("unexpected invocation of MockStore.MarkQueued") - }, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: func(context.Context) (int, error) { - panic("unexpected invocation of MockStore.NumRepositoriesWithCodeIntelligence") - }, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.ProcessSourcedCommits") - }, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - panic("unexpected invocation of MockStore.ProcessStaleSourcedCommits") - }, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: func(context.Context, int) ([]int, error) { - panic("unexpected invocation of MockStore.ReconcileCandidates") - }, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: func(context.Context, int) (shared1.PackageReferenceScanner, error) { - panic("unexpected invocation of MockStore.ReferencesForUpload") - }, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.ReindexUploadByID") - }, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: func(context.Context, shared1.ReindexUploadsOptions) error { - panic("unexpected invocation of MockStore.ReindexUploads") - }, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) { - panic("unexpected invocation of MockStore.RepositoryIDsWithErrors") - }, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: func(context.Context, time.Duration, int) ([]int, error) { - panic("unexpected invocation of MockStore.SetRepositoriesForRetentionScan") - }, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.SetRepositoryAsDirty") - }, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.SetRerunAutoIndexJobByID") - }, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error { - panic("unexpected invocation of MockStore.SetRerunAutoIndexJobs") - }, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: func(context.Context, int) (int, int, error) { - panic("unexpected invocation of MockStore.SoftDeleteExpiredUploads") - }, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: func(context.Context, int) (int, int, error) { - panic("unexpected invocation of MockStore.SoftDeleteExpiredUploadsViaTraversal") - }, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: func(context.Context, int) ([]store.SourcedCommits, error) { - panic("unexpected invocation of MockStore.SourcedCommitsWithoutCommittedAt") - }, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: func(context.Context, int, string, string) error { - panic("unexpected invocation of MockStore.UpdateCommittedAt") - }, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: func(context.Context, int, []precise.PackageReference) error { - panic("unexpected invocation of MockStore.UpdatePackageReferences") - }, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: func(context.Context, int, []precise.Package) error { - panic("unexpected invocation of MockStore.UpdatePackages") - }, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: func(context.Context, []int, []int) error { - panic("unexpected invocation of MockStore.UpdateUploadRetention") - }, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - panic("unexpected invocation of MockStore.UpdateUploadsVisibleToCommits") - }, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: func(context.Context, func(s store.Store) error) error { - panic("unexpected invocation of MockStore.WithTransaction") - }, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: func(*observation.Context) store1.Store[shared1.Upload] { - panic("unexpected invocation of MockStore.WorkerutilStore") - }, - }, - } -} - -// NewMockStoreFrom creates a new mock of the MockStore interface. All -// methods delegate to the given implementation, unless overwritten. -func NewMockStoreFrom(i store.Store) *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: i.AddUploadPart, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: i.DeleteAutoIndexJobByID, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: i.DeleteAutoIndexJobs, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: i.DeleteAutoIndexJobsWithoutRepository, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: i.DeleteOldAuditLogs, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: i.DeleteOverlappingCompletedUploads, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: i.DeleteUploadByID, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: i.DeleteUploads, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: i.DeleteUploadsStuckUploading, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: i.DeleteUploadsWithoutRepository, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: i.ExpireFailedRecords, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: i.FindClosestCompletedUploads, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: i.FindClosestCompletedUploadsFromGraphFragment, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: i.GetAuditLogsForUpload, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: i.GetAutoIndexJobByID, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: i.GetAutoIndexJobs, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: i.GetAutoIndexJobsByIDs, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: i.GetCommitAndDateForOldestUpload, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: i.GetCommitGraphMetadata, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: i.GetCommitsVisibleToUpload, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: i.GetCompletedUploadsByIDs, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: i.GetCompletedUploadsWithDefinitionsForMonikers, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: i.GetDirtyRepositories, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: i.GetIndexers, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: i.GetLastUploadRetentionScanForRepository, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: i.GetRecentAutoIndexJobsSummary, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: i.GetRecentUploadsSummary, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: i.GetRepositoriesMaxStaleAge, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: i.GetUploadByID, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: i.GetUploadIDsWithReferences, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: i.GetUploads, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: i.GetUploadsByIDs, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: i.GetUploadsByIDsAllowDeleted, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: i.GetVisibleUploadsMatchingMonikers, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: i.Handle, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: i.HardDeleteUploadsByIDs, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: i.HasCommit, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: i.HasRepository, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: i.InsertDependencySyncingJob, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: i.InsertUpload, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: i.MarkFailed, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: i.MarkQueued, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: i.NumRepositoriesWithCodeIntelligence, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: i.ProcessSourcedCommits, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: i.ProcessStaleSourcedCommits, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: i.ReconcileCandidates, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: i.ReferencesForUpload, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: i.ReindexUploadByID, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: i.ReindexUploads, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: i.RepositoryIDsWithErrors, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: i.SetRepositoriesForRetentionScan, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: i.SetRepositoryAsDirty, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: i.SetRerunAutoIndexJobByID, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: i.SetRerunAutoIndexJobs, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: i.SoftDeleteExpiredUploads, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: i.SoftDeleteExpiredUploadsViaTraversal, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: i.SourcedCommitsWithoutCommittedAt, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: i.UpdateCommittedAt, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: i.UpdatePackageReferences, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: i.UpdatePackages, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: i.UpdateUploadRetention, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: i.UpdateUploadsVisibleToCommits, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: i.WithTransaction, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: i.WorkerutilStore, - }, - } -} - -// StoreAddUploadPartFunc describes the behavior when the AddUploadPart -// method of the parent MockStore instance is invoked. -type StoreAddUploadPartFunc struct { - defaultHook func(context.Context, int, int) error - hooks []func(context.Context, int, int) error - history []StoreAddUploadPartFuncCall - mutex sync.Mutex -} - -// AddUploadPart delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) AddUploadPart(v0 context.Context, v1 int, v2 int) error { - r0 := m.AddUploadPartFunc.nextHook()(v0, v1, v2) - m.AddUploadPartFunc.appendCall(StoreAddUploadPartFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the AddUploadPart method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreAddUploadPartFunc) SetDefaultHook(hook func(context.Context, int, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// AddUploadPart method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreAddUploadPartFunc) PushHook(hook func(context.Context, int, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreAddUploadPartFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreAddUploadPartFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, int) error { - return r0 - }) -} - -func (f *StoreAddUploadPartFunc) nextHook() func(context.Context, int, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreAddUploadPartFunc) appendCall(r0 StoreAddUploadPartFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreAddUploadPartFuncCall objects -// describing the invocations of this function. -func (f *StoreAddUploadPartFunc) History() []StoreAddUploadPartFuncCall { - f.mutex.Lock() - history := make([]StoreAddUploadPartFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreAddUploadPartFuncCall is an object that describes an invocation of -// method AddUploadPart on an instance of MockStore. -type StoreAddUploadPartFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreAddUploadPartFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreAddUploadPartFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteAutoIndexJobByIDFunc describes the behavior when the -// DeleteAutoIndexJobByID method of the parent MockStore instance is -// invoked. -type StoreDeleteAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) (bool, error) - hooks []func(context.Context, int) (bool, error) - history []StoreDeleteAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobByID delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteAutoIndexJobByID(v0 context.Context, v1 int) (bool, error) { - r0, r1 := m.DeleteAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobByIDFunc.appendCall(StoreDeleteAutoIndexJobByIDFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// DeleteAutoIndexJobByID method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreDeleteAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobByID method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreDeleteAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobByIDFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobByIDFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreDeleteAutoIndexJobByIDFunc) nextHook() func(context.Context, int) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobByIDFunc) appendCall(r0 StoreDeleteAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteAutoIndexJobByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteAutoIndexJobByIDFunc) History() []StoreDeleteAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method DeleteAutoIndexJobByID on an instance of MockStore. -type StoreDeleteAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreDeleteAutoIndexJobsFunc describes the behavior when the -// DeleteAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreDeleteAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared1.DeleteAutoIndexJobsOptions) error - hooks []func(context.Context, shared1.DeleteAutoIndexJobsOptions) error - history []StoreDeleteAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteAutoIndexJobs(v0 context.Context, v1 shared1.DeleteAutoIndexJobsOptions) error { - r0 := m.DeleteAutoIndexJobsFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobsFunc.appendCall(StoreDeleteAutoIndexJobsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the DeleteAutoIndexJobs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared1.DeleteAutoIndexJobsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreDeleteAutoIndexJobsFunc) PushHook(hook func(context.Context, shared1.DeleteAutoIndexJobsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared1.DeleteAutoIndexJobsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared1.DeleteAutoIndexJobsOptions) error { - return r0 - }) -} - -func (f *StoreDeleteAutoIndexJobsFunc) nextHook() func(context.Context, shared1.DeleteAutoIndexJobsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobsFunc) appendCall(r0 StoreDeleteAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteAutoIndexJobsFunc) History() []StoreDeleteAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobsFuncCall is an object that describes an -// invocation of method DeleteAutoIndexJobs on an instance of MockStore. -type StoreDeleteAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.DeleteAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteAutoIndexJobsWithoutRepositoryFunc describes the behavior when -// the DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance is invoked. -type StoreDeleteAutoIndexJobsWithoutRepositoryFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobsWithoutRepository delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) DeleteAutoIndexJobsWithoutRepository(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteAutoIndexJobsWithoutRepositoryFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobsWithoutRepositoryFunc.appendCall(StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) appendCall(r0 StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall objects describing the -// invocations of this function. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) History() []StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall is an object that -// describes an invocation of method DeleteAutoIndexJobsWithoutRepository on -// an instance of MockStore. -type StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteOldAuditLogsFunc describes the behavior when the -// DeleteOldAuditLogs method of the parent MockStore instance is invoked. -type StoreDeleteOldAuditLogsFunc struct { - defaultHook func(context.Context, time.Duration, time.Time) (int, int, error) - hooks []func(context.Context, time.Duration, time.Time) (int, int, error) - history []StoreDeleteOldAuditLogsFuncCall - mutex sync.Mutex -} - -// DeleteOldAuditLogs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteOldAuditLogs(v0 context.Context, v1 time.Duration, v2 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteOldAuditLogsFunc.nextHook()(v0, v1, v2) - m.DeleteOldAuditLogsFunc.appendCall(StoreDeleteOldAuditLogsFuncCall{v0, v1, v2, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the DeleteOldAuditLogs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteOldAuditLogsFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteOldAuditLogs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreDeleteOldAuditLogsFunc) PushHook(hook func(context.Context, time.Duration, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteOldAuditLogsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteOldAuditLogsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteOldAuditLogsFunc) nextHook() func(context.Context, time.Duration, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteOldAuditLogsFunc) appendCall(r0 StoreDeleteOldAuditLogsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteOldAuditLogsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteOldAuditLogsFunc) History() []StoreDeleteOldAuditLogsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteOldAuditLogsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteOldAuditLogsFuncCall is an object that describes an invocation -// of method DeleteOldAuditLogs on an instance of MockStore. -type StoreDeleteOldAuditLogsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteOldAuditLogsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteOldAuditLogsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteOverlappingCompletedUploadsFunc describes the behavior when -// the DeleteOverlappingCompletedUploads method of the parent MockStore -// instance is invoked. -type StoreDeleteOverlappingCompletedUploadsFunc struct { - defaultHook func(context.Context, int, string, string, string) error - hooks []func(context.Context, int, string, string, string) error - history []StoreDeleteOverlappingCompletedUploadsFuncCall - mutex sync.Mutex -} - -// DeleteOverlappingCompletedUploads delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteOverlappingCompletedUploads(v0 context.Context, v1 int, v2 string, v3 string, v4 string) error { - r0 := m.DeleteOverlappingCompletedUploadsFunc.nextHook()(v0, v1, v2, v3, v4) - m.DeleteOverlappingCompletedUploadsFunc.appendCall(StoreDeleteOverlappingCompletedUploadsFuncCall{v0, v1, v2, v3, v4, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// DeleteOverlappingCompletedUploads method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) SetDefaultHook(hook func(context.Context, int, string, string, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteOverlappingCompletedUploads method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) PushHook(hook func(context.Context, int, string, string, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string, string, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string, string, string) error { - return r0 - }) -} - -func (f *StoreDeleteOverlappingCompletedUploadsFunc) nextHook() func(context.Context, int, string, string, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteOverlappingCompletedUploadsFunc) appendCall(r0 StoreDeleteOverlappingCompletedUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreDeleteOverlappingCompletedUploadsFuncCall objects describing the -// invocations of this function. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) History() []StoreDeleteOverlappingCompletedUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteOverlappingCompletedUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteOverlappingCompletedUploadsFuncCall is an object that -// describes an invocation of method DeleteOverlappingCompletedUploads on an -// instance of MockStore. -type StoreDeleteOverlappingCompletedUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 string - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteOverlappingCompletedUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteOverlappingCompletedUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteUploadByIDFunc describes the behavior when the -// DeleteUploadByID method of the parent MockStore instance is invoked. -type StoreDeleteUploadByIDFunc struct { - defaultHook func(context.Context, int) (bool, error) - hooks []func(context.Context, int) (bool, error) - history []StoreDeleteUploadByIDFuncCall - mutex sync.Mutex -} - -// DeleteUploadByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadByID(v0 context.Context, v1 int) (bool, error) { - r0, r1 := m.DeleteUploadByIDFunc.nextHook()(v0, v1) - m.DeleteUploadByIDFunc.appendCall(StoreDeleteUploadByIDFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the DeleteUploadByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadByID method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreDeleteUploadByIDFunc) PushHook(hook func(context.Context, int) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadByIDFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadByIDFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreDeleteUploadByIDFunc) nextHook() func(context.Context, int) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadByIDFunc) appendCall(r0 StoreDeleteUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteUploadByIDFunc) History() []StoreDeleteUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadByIDFuncCall is an object that describes an invocation -// of method DeleteUploadByID on an instance of MockStore. -type StoreDeleteUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreDeleteUploadsFunc describes the behavior when the DeleteUploads -// method of the parent MockStore instance is invoked. -type StoreDeleteUploadsFunc struct { - defaultHook func(context.Context, shared1.DeleteUploadsOptions) error - hooks []func(context.Context, shared1.DeleteUploadsOptions) error - history []StoreDeleteUploadsFuncCall - mutex sync.Mutex -} - -// DeleteUploads delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) DeleteUploads(v0 context.Context, v1 shared1.DeleteUploadsOptions) error { - r0 := m.DeleteUploadsFunc.nextHook()(v0, v1) - m.DeleteUploadsFunc.appendCall(StoreDeleteUploadsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the DeleteUploads method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreDeleteUploadsFunc) SetDefaultHook(hook func(context.Context, shared1.DeleteUploadsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploads method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreDeleteUploadsFunc) PushHook(hook func(context.Context, shared1.DeleteUploadsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared1.DeleteUploadsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared1.DeleteUploadsOptions) error { - return r0 - }) -} - -func (f *StoreDeleteUploadsFunc) nextHook() func(context.Context, shared1.DeleteUploadsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsFunc) appendCall(r0 StoreDeleteUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteUploadsFunc) History() []StoreDeleteUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsFuncCall is an object that describes an invocation of -// method DeleteUploads on an instance of MockStore. -type StoreDeleteUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.DeleteUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteUploadsStuckUploadingFunc describes the behavior when the -// DeleteUploadsStuckUploading method of the parent MockStore instance is -// invoked. -type StoreDeleteUploadsStuckUploadingFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteUploadsStuckUploadingFuncCall - mutex sync.Mutex -} - -// DeleteUploadsStuckUploading delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadsStuckUploading(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteUploadsStuckUploadingFunc.nextHook()(v0, v1) - m.DeleteUploadsStuckUploadingFunc.appendCall(StoreDeleteUploadsStuckUploadingFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteUploadsStuckUploading method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreDeleteUploadsStuckUploadingFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadsStuckUploading method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteUploadsStuckUploadingFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsStuckUploadingFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsStuckUploadingFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteUploadsStuckUploadingFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsStuckUploadingFunc) appendCall(r0 StoreDeleteUploadsStuckUploadingFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsStuckUploadingFuncCall -// objects describing the invocations of this function. -func (f *StoreDeleteUploadsStuckUploadingFunc) History() []StoreDeleteUploadsStuckUploadingFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsStuckUploadingFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsStuckUploadingFuncCall is an object that describes an -// invocation of method DeleteUploadsStuckUploading on an instance of -// MockStore. -type StoreDeleteUploadsStuckUploadingFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsStuckUploadingFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsStuckUploadingFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteUploadsWithoutRepositoryFunc describes the behavior when the -// DeleteUploadsWithoutRepository method of the parent MockStore instance is -// invoked. -type StoreDeleteUploadsWithoutRepositoryFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteUploadsWithoutRepositoryFuncCall - mutex sync.Mutex -} - -// DeleteUploadsWithoutRepository delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadsWithoutRepository(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteUploadsWithoutRepositoryFunc.nextHook()(v0, v1) - m.DeleteUploadsWithoutRepositoryFunc.appendCall(StoreDeleteUploadsWithoutRepositoryFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteUploadsWithoutRepository method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadsWithoutRepository method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteUploadsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsWithoutRepositoryFunc) appendCall(r0 StoreDeleteUploadsWithoutRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsWithoutRepositoryFuncCall -// objects describing the invocations of this function. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) History() []StoreDeleteUploadsWithoutRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsWithoutRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsWithoutRepositoryFuncCall is an object that describes -// an invocation of method DeleteUploadsWithoutRepository on an instance of -// MockStore. -type StoreDeleteUploadsWithoutRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsWithoutRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsWithoutRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreExpireFailedRecordsFunc describes the behavior when the -// ExpireFailedRecords method of the parent MockStore instance is invoked. -type StoreExpireFailedRecordsFunc struct { - defaultHook func(context.Context, int, time.Duration, time.Time) (int, int, error) - hooks []func(context.Context, int, time.Duration, time.Time) (int, int, error) - history []StoreExpireFailedRecordsFuncCall - mutex sync.Mutex -} - -// ExpireFailedRecords delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ExpireFailedRecords(v0 context.Context, v1 int, v2 time.Duration, v3 time.Time) (int, int, error) { - r0, r1, r2 := m.ExpireFailedRecordsFunc.nextHook()(v0, v1, v2, v3) - m.ExpireFailedRecordsFunc.appendCall(StoreExpireFailedRecordsFuncCall{v0, v1, v2, v3, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the ExpireFailedRecords -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreExpireFailedRecordsFunc) SetDefaultHook(hook func(context.Context, int, time.Duration, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ExpireFailedRecords method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreExpireFailedRecordsFunc) PushHook(hook func(context.Context, int, time.Duration, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreExpireFailedRecordsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreExpireFailedRecordsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreExpireFailedRecordsFunc) nextHook() func(context.Context, int, time.Duration, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreExpireFailedRecordsFunc) appendCall(r0 StoreExpireFailedRecordsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreExpireFailedRecordsFuncCall objects -// describing the invocations of this function. -func (f *StoreExpireFailedRecordsFunc) History() []StoreExpireFailedRecordsFuncCall { - f.mutex.Lock() - history := make([]StoreExpireFailedRecordsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreExpireFailedRecordsFuncCall is an object that describes an -// invocation of method ExpireFailedRecords on an instance of MockStore. -type StoreExpireFailedRecordsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Duration - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreExpireFailedRecordsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreExpireFailedRecordsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreFindClosestCompletedUploadsFunc describes the behavior when the -// FindClosestCompletedUploads method of the parent MockStore instance is -// invoked. -type StoreFindClosestCompletedUploadsFunc struct { - defaultHook func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) - hooks []func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) - history []StoreFindClosestCompletedUploadsFuncCall - mutex sync.Mutex -} - -// FindClosestCompletedUploads delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) FindClosestCompletedUploads(v0 context.Context, v1 shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) { - r0, r1 := m.FindClosestCompletedUploadsFunc.nextHook()(v0, v1) - m.FindClosestCompletedUploadsFunc.appendCall(StoreFindClosestCompletedUploadsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// FindClosestCompletedUploads method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreFindClosestCompletedUploadsFunc) SetDefaultHook(hook func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// FindClosestCompletedUploads method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreFindClosestCompletedUploadsFunc) PushHook(hook func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreFindClosestCompletedUploadsFunc) SetDefaultReturn(r0 []shared1.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreFindClosestCompletedUploadsFunc) PushReturn(r0 []shared1.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreFindClosestCompletedUploadsFunc) nextHook() func(context.Context, shared1.UploadMatchingOptions) ([]shared1.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreFindClosestCompletedUploadsFunc) appendCall(r0 StoreFindClosestCompletedUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreFindClosestCompletedUploadsFuncCall -// objects describing the invocations of this function. -func (f *StoreFindClosestCompletedUploadsFunc) History() []StoreFindClosestCompletedUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreFindClosestCompletedUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreFindClosestCompletedUploadsFuncCall is an object that describes an -// invocation of method FindClosestCompletedUploads on an instance of -// MockStore. -type StoreFindClosestCompletedUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.UploadMatchingOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreFindClosestCompletedUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreFindClosestCompletedUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreFindClosestCompletedUploadsFromGraphFragmentFunc describes the -// behavior when the FindClosestCompletedUploadsFromGraphFragment method of -// the parent MockStore instance is invoked. -type StoreFindClosestCompletedUploadsFromGraphFragmentFunc struct { - defaultHook func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) - hooks []func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) - history []StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall - mutex sync.Mutex -} - -// FindClosestCompletedUploadsFromGraphFragment delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) FindClosestCompletedUploadsFromGraphFragment(v0 context.Context, v1 shared1.UploadMatchingOptions, v2 *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) { - r0, r1 := m.FindClosestCompletedUploadsFromGraphFragmentFunc.nextHook()(v0, v1, v2) - m.FindClosestCompletedUploadsFromGraphFragmentFunc.appendCall(StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// FindClosestCompletedUploadsFromGraphFragment method of the parent -// MockStore instance is invoked and the hook queue is empty. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) SetDefaultHook(hook func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// FindClosestCompletedUploadsFromGraphFragment method of the parent -// MockStore instance invokes the hook at the front of the queue and -// discards it. After the queue is empty, the default hook function is -// invoked for any future action. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) PushHook(hook func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) SetDefaultReturn(r0 []shared1.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) PushReturn(r0 []shared1.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) nextHook() func(context.Context, shared1.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared1.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) appendCall(r0 StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall objects -// describing the invocations of this function. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) History() []StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall { - f.mutex.Lock() - history := make([]StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall is an object -// that describes an invocation of method -// FindClosestCompletedUploadsFromGraphFragment on an instance of MockStore. -type StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.UploadMatchingOptions - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *commitgraph.CommitGraph - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetAuditLogsForUploadFunc describes the behavior when the -// GetAuditLogsForUpload method of the parent MockStore instance is invoked. -type StoreGetAuditLogsForUploadFunc struct { - defaultHook func(context.Context, int) ([]shared1.UploadLog, error) - hooks []func(context.Context, int) ([]shared1.UploadLog, error) - history []StoreGetAuditLogsForUploadFuncCall - mutex sync.Mutex -} - -// GetAuditLogsForUpload delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetAuditLogsForUpload(v0 context.Context, v1 int) ([]shared1.UploadLog, error) { - r0, r1 := m.GetAuditLogsForUploadFunc.nextHook()(v0, v1) - m.GetAuditLogsForUploadFunc.appendCall(StoreGetAuditLogsForUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetAuditLogsForUpload method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetAuditLogsForUploadFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.UploadLog, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAuditLogsForUpload method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAuditLogsForUploadFunc) PushHook(hook func(context.Context, int) ([]shared1.UploadLog, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAuditLogsForUploadFunc) SetDefaultReturn(r0 []shared1.UploadLog, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared1.UploadLog, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAuditLogsForUploadFunc) PushReturn(r0 []shared1.UploadLog, r1 error) { - f.PushHook(func(context.Context, int) ([]shared1.UploadLog, error) { - return r0, r1 - }) -} - -func (f *StoreGetAuditLogsForUploadFunc) nextHook() func(context.Context, int) ([]shared1.UploadLog, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAuditLogsForUploadFunc) appendCall(r0 StoreGetAuditLogsForUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAuditLogsForUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAuditLogsForUploadFunc) History() []StoreGetAuditLogsForUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetAuditLogsForUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAuditLogsForUploadFuncCall is an object that describes an -// invocation of method GetAuditLogsForUpload on an instance of MockStore. -type StoreGetAuditLogsForUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.UploadLog - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAuditLogsForUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAuditLogsForUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetAutoIndexJobByIDFunc describes the behavior when the -// GetAutoIndexJobByID method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) (shared1.AutoIndexJob, bool, error) - hooks []func(context.Context, int) (shared1.AutoIndexJob, bool, error) - history []StoreGetAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobByID(v0 context.Context, v1 int) (shared1.AutoIndexJob, bool, error) { - r0, r1, r2 := m.GetAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.GetAutoIndexJobByIDFunc.appendCall(StoreGetAutoIndexJobByIDFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetAutoIndexJobByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) (shared1.AutoIndexJob, bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobByID method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) (shared1.AutoIndexJob, bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobByIDFunc) SetDefaultReturn(r0 shared1.AutoIndexJob, r1 bool, r2 error) { - f.SetDefaultHook(func(context.Context, int) (shared1.AutoIndexJob, bool, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobByIDFunc) PushReturn(r0 shared1.AutoIndexJob, r1 bool, r2 error) { - f.PushHook(func(context.Context, int) (shared1.AutoIndexJob, bool, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetAutoIndexJobByIDFunc) nextHook() func(context.Context, int) (shared1.AutoIndexJob, bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobByIDFunc) appendCall(r0 StoreGetAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobByIDFunc) History() []StoreGetAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method GetAutoIndexJobByID on an instance of MockStore. -type StoreGetAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared1.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 bool - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetAutoIndexJobsFunc describes the behavior when the -// GetAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) - hooks []func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) - history []StoreGetAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobs(v0 context.Context, v1 shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) { - r0, r1, r2 := m.GetAutoIndexJobsFunc.nextHook()(v0, v1) - m.GetAutoIndexJobsFunc.appendCall(StoreGetAutoIndexJobsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetAutoIndexJobs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobs method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobsFunc) PushHook(hook func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobsFunc) SetDefaultReturn(r0 []shared1.AutoIndexJob, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobsFunc) PushReturn(r0 []shared1.AutoIndexJob, r1 int, r2 error) { - f.PushHook(func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetAutoIndexJobsFunc) nextHook() func(context.Context, shared1.GetAutoIndexJobsOptions) ([]shared1.AutoIndexJob, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobsFunc) appendCall(r0 StoreGetAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobsFunc) History() []StoreGetAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobsFuncCall is an object that describes an invocation -// of method GetAutoIndexJobs on an instance of MockStore. -type StoreGetAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.GetAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetAutoIndexJobsByIDsFunc describes the behavior when the -// GetAutoIndexJobsByIDs method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobsByIDsFunc struct { - defaultHook func(context.Context, ...int) ([]shared1.AutoIndexJob, error) - hooks []func(context.Context, ...int) ([]shared1.AutoIndexJob, error) - history []StoreGetAutoIndexJobsByIDsFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobsByIDs(v0 context.Context, v1 ...int) ([]shared1.AutoIndexJob, error) { - r0, r1 := m.GetAutoIndexJobsByIDsFunc.nextHook()(v0, v1...) - m.GetAutoIndexJobsByIDsFunc.appendCall(StoreGetAutoIndexJobsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetAutoIndexJobsByIDs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetAutoIndexJobsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared1.AutoIndexJob, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobsByIDs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobsByIDsFunc) PushHook(hook func(context.Context, ...int) ([]shared1.AutoIndexJob, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobsByIDsFunc) SetDefaultReturn(r0 []shared1.AutoIndexJob, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared1.AutoIndexJob, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobsByIDsFunc) PushReturn(r0 []shared1.AutoIndexJob, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared1.AutoIndexJob, error) { - return r0, r1 - }) -} - -func (f *StoreGetAutoIndexJobsByIDsFunc) nextHook() func(context.Context, ...int) ([]shared1.AutoIndexJob, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobsByIDsFunc) appendCall(r0 StoreGetAutoIndexJobsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobsByIDsFunc) History() []StoreGetAutoIndexJobsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobsByIDsFuncCall is an object that describes an -// invocation of method GetAutoIndexJobsByIDs on an instance of MockStore. -type StoreGetAutoIndexJobsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetAutoIndexJobsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCommitAndDateForOldestUploadFunc describes the behavior when the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// is invoked. -type StoreGetCommitAndDateForOldestUploadFunc struct { - defaultHook func(context.Context, int) (core.Option[store.CommitWithDate], error) - hooks []func(context.Context, int) (core.Option[store.CommitWithDate], error) - history []StoreGetCommitAndDateForOldestUploadFuncCall - mutex sync.Mutex -} - -// GetCommitAndDateForOldestUpload delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitAndDateForOldestUpload(v0 context.Context, v1 int) (core.Option[store.CommitWithDate], error) { - r0, r1 := m.GetCommitAndDateForOldestUploadFunc.nextHook()(v0, v1) - m.GetCommitAndDateForOldestUploadFunc.appendCall(StoreGetCommitAndDateForOldestUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreGetCommitAndDateForOldestUploadFunc) SetDefaultHook(hook func(context.Context, int) (core.Option[store.CommitWithDate], error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetCommitAndDateForOldestUploadFunc) PushHook(hook func(context.Context, int) (core.Option[store.CommitWithDate], error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitAndDateForOldestUploadFunc) SetDefaultReturn(r0 core.Option[store.CommitWithDate], r1 error) { - f.SetDefaultHook(func(context.Context, int) (core.Option[store.CommitWithDate], error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitAndDateForOldestUploadFunc) PushReturn(r0 core.Option[store.CommitWithDate], r1 error) { - f.PushHook(func(context.Context, int) (core.Option[store.CommitWithDate], error) { - return r0, r1 - }) -} - -func (f *StoreGetCommitAndDateForOldestUploadFunc) nextHook() func(context.Context, int) (core.Option[store.CommitWithDate], error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitAndDateForOldestUploadFunc) appendCall(r0 StoreGetCommitAndDateForOldestUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetCommitAndDateForOldestUploadFuncCall objects describing the -// invocations of this function. -func (f *StoreGetCommitAndDateForOldestUploadFunc) History() []StoreGetCommitAndDateForOldestUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitAndDateForOldestUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitAndDateForOldestUploadFuncCall is an object that describes -// an invocation of method GetCommitAndDateForOldestUpload on an instance of -// MockStore. -type StoreGetCommitAndDateForOldestUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 core.Option[store.CommitWithDate] - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitAndDateForOldestUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitAndDateForOldestUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCommitGraphMetadataFunc describes the behavior when the -// GetCommitGraphMetadata method of the parent MockStore instance is -// invoked. -type StoreGetCommitGraphMetadataFunc struct { - defaultHook func(context.Context, int) (bool, *time.Time, error) - hooks []func(context.Context, int) (bool, *time.Time, error) - history []StoreGetCommitGraphMetadataFuncCall - mutex sync.Mutex -} - -// GetCommitGraphMetadata delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitGraphMetadata(v0 context.Context, v1 int) (bool, *time.Time, error) { - r0, r1, r2 := m.GetCommitGraphMetadataFunc.nextHook()(v0, v1) - m.GetCommitGraphMetadataFunc.appendCall(StoreGetCommitGraphMetadataFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetCommitGraphMetadata method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetCommitGraphMetadataFunc) SetDefaultHook(hook func(context.Context, int) (bool, *time.Time, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitGraphMetadata method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCommitGraphMetadataFunc) PushHook(hook func(context.Context, int) (bool, *time.Time, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitGraphMetadataFunc) SetDefaultReturn(r0 bool, r1 *time.Time, r2 error) { - f.SetDefaultHook(func(context.Context, int) (bool, *time.Time, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitGraphMetadataFunc) PushReturn(r0 bool, r1 *time.Time, r2 error) { - f.PushHook(func(context.Context, int) (bool, *time.Time, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetCommitGraphMetadataFunc) nextHook() func(context.Context, int) (bool, *time.Time, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitGraphMetadataFunc) appendCall(r0 StoreGetCommitGraphMetadataFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCommitGraphMetadataFuncCall objects -// describing the invocations of this function. -func (f *StoreGetCommitGraphMetadataFunc) History() []StoreGetCommitGraphMetadataFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitGraphMetadataFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitGraphMetadataFuncCall is an object that describes an -// invocation of method GetCommitGraphMetadata on an instance of MockStore. -type StoreGetCommitGraphMetadataFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 *time.Time - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitGraphMetadataFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitGraphMetadataFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetCommitsVisibleToUploadFunc describes the behavior when the -// GetCommitsVisibleToUpload method of the parent MockStore instance is -// invoked. -type StoreGetCommitsVisibleToUploadFunc struct { - defaultHook func(context.Context, int, int, *string) ([]string, *string, error) - hooks []func(context.Context, int, int, *string) ([]string, *string, error) - history []StoreGetCommitsVisibleToUploadFuncCall - mutex sync.Mutex -} - -// GetCommitsVisibleToUpload delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitsVisibleToUpload(v0 context.Context, v1 int, v2 int, v3 *string) ([]string, *string, error) { - r0, r1, r2 := m.GetCommitsVisibleToUploadFunc.nextHook()(v0, v1, v2, v3) - m.GetCommitsVisibleToUploadFunc.appendCall(StoreGetCommitsVisibleToUploadFuncCall{v0, v1, v2, v3, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetCommitsVisibleToUpload method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetCommitsVisibleToUploadFunc) SetDefaultHook(hook func(context.Context, int, int, *string) ([]string, *string, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitsVisibleToUpload method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCommitsVisibleToUploadFunc) PushHook(hook func(context.Context, int, int, *string) ([]string, *string, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitsVisibleToUploadFunc) SetDefaultReturn(r0 []string, r1 *string, r2 error) { - f.SetDefaultHook(func(context.Context, int, int, *string) ([]string, *string, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitsVisibleToUploadFunc) PushReturn(r0 []string, r1 *string, r2 error) { - f.PushHook(func(context.Context, int, int, *string) ([]string, *string, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetCommitsVisibleToUploadFunc) nextHook() func(context.Context, int, int, *string) ([]string, *string, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitsVisibleToUploadFunc) appendCall(r0 StoreGetCommitsVisibleToUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCommitsVisibleToUploadFuncCall -// objects describing the invocations of this function. -func (f *StoreGetCommitsVisibleToUploadFunc) History() []StoreGetCommitsVisibleToUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitsVisibleToUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitsVisibleToUploadFuncCall is an object that describes an -// invocation of method GetCommitsVisibleToUpload on an instance of -// MockStore. -type StoreGetCommitsVisibleToUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 *string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []string - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 *string - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitsVisibleToUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitsVisibleToUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetCompletedUploadsByIDsFunc describes the behavior when the -// GetCompletedUploadsByIDs method of the parent MockStore instance is -// invoked. -type StoreGetCompletedUploadsByIDsFunc struct { - defaultHook func(context.Context, []int) ([]shared1.CompletedUpload, error) - hooks []func(context.Context, []int) ([]shared1.CompletedUpload, error) - history []StoreGetCompletedUploadsByIDsFuncCall - mutex sync.Mutex -} - -// GetCompletedUploadsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetCompletedUploadsByIDs(v0 context.Context, v1 []int) ([]shared1.CompletedUpload, error) { - r0, r1 := m.GetCompletedUploadsByIDsFunc.nextHook()(v0, v1) - m.GetCompletedUploadsByIDsFunc.appendCall(StoreGetCompletedUploadsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCompletedUploadsByIDs method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetCompletedUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, []int) ([]shared1.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCompletedUploadsByIDs method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCompletedUploadsByIDsFunc) PushHook(hook func(context.Context, []int) ([]shared1.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCompletedUploadsByIDsFunc) SetDefaultReturn(r0 []shared1.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, []int) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCompletedUploadsByIDsFunc) PushReturn(r0 []shared1.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, []int) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreGetCompletedUploadsByIDsFunc) nextHook() func(context.Context, []int) ([]shared1.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCompletedUploadsByIDsFunc) appendCall(r0 StoreGetCompletedUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCompletedUploadsByIDsFuncCall -// objects describing the invocations of this function. -func (f *StoreGetCompletedUploadsByIDsFunc) History() []StoreGetCompletedUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetCompletedUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCompletedUploadsByIDsFuncCall is an object that describes an -// invocation of method GetCompletedUploadsByIDs on an instance of -// MockStore. -type StoreGetCompletedUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCompletedUploadsByIDsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCompletedUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCompletedUploadsWithDefinitionsForMonikersFunc describes the -// behavior when the GetCompletedUploadsWithDefinitionsForMonikers method of -// the parent MockStore instance is invoked. -type StoreGetCompletedUploadsWithDefinitionsForMonikersFunc struct { - defaultHook func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) - hooks []func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) - history []StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall - mutex sync.Mutex -} - -// GetCompletedUploadsWithDefinitionsForMonikers delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) GetCompletedUploadsWithDefinitionsForMonikers(v0 context.Context, v1 []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) { - r0, r1 := m.GetCompletedUploadsWithDefinitionsForMonikersFunc.nextHook()(v0, v1) - m.GetCompletedUploadsWithDefinitionsForMonikersFunc.appendCall(StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCompletedUploadsWithDefinitionsForMonikers method of the parent -// MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) SetDefaultHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCompletedUploadsWithDefinitionsForMonikers method of the parent -// MockStore instance invokes the hook at the front of the queue and -// discards it. After the queue is empty, the default hook function is -// invoked for any future action. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) PushHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) SetDefaultReturn(r0 []shared1.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) PushReturn(r0 []shared1.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) nextHook() func(context.Context, []precise.QualifiedMonikerData) ([]shared1.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) appendCall(r0 StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall objects -// describing the invocations of this function. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) History() []StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall { - f.mutex.Lock() - history := make([]StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall is an object -// that describes an invocation of method -// GetCompletedUploadsWithDefinitionsForMonikers on an instance of -// MockStore. -type StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []precise.QualifiedMonikerData - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetDirtyRepositoriesFunc describes the behavior when the -// GetDirtyRepositories method of the parent MockStore instance is invoked. -type StoreGetDirtyRepositoriesFunc struct { - defaultHook func(context.Context) ([]shared1.DirtyRepository, error) - hooks []func(context.Context) ([]shared1.DirtyRepository, error) - history []StoreGetDirtyRepositoriesFuncCall - mutex sync.Mutex -} - -// GetDirtyRepositories delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetDirtyRepositories(v0 context.Context) ([]shared1.DirtyRepository, error) { - r0, r1 := m.GetDirtyRepositoriesFunc.nextHook()(v0) - m.GetDirtyRepositoriesFunc.appendCall(StoreGetDirtyRepositoriesFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetDirtyRepositories -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetDirtyRepositoriesFunc) SetDefaultHook(hook func(context.Context) ([]shared1.DirtyRepository, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetDirtyRepositories method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetDirtyRepositoriesFunc) PushHook(hook func(context.Context) ([]shared1.DirtyRepository, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetDirtyRepositoriesFunc) SetDefaultReturn(r0 []shared1.DirtyRepository, r1 error) { - f.SetDefaultHook(func(context.Context) ([]shared1.DirtyRepository, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetDirtyRepositoriesFunc) PushReturn(r0 []shared1.DirtyRepository, r1 error) { - f.PushHook(func(context.Context) ([]shared1.DirtyRepository, error) { - return r0, r1 - }) -} - -func (f *StoreGetDirtyRepositoriesFunc) nextHook() func(context.Context) ([]shared1.DirtyRepository, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetDirtyRepositoriesFunc) appendCall(r0 StoreGetDirtyRepositoriesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetDirtyRepositoriesFuncCall objects -// describing the invocations of this function. -func (f *StoreGetDirtyRepositoriesFunc) History() []StoreGetDirtyRepositoriesFuncCall { - f.mutex.Lock() - history := make([]StoreGetDirtyRepositoriesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetDirtyRepositoriesFuncCall is an object that describes an -// invocation of method GetDirtyRepositories on an instance of MockStore. -type StoreGetDirtyRepositoriesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.DirtyRepository - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetDirtyRepositoriesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetDirtyRepositoriesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetIndexersFunc describes the behavior when the GetIndexers method -// of the parent MockStore instance is invoked. -type StoreGetIndexersFunc struct { - defaultHook func(context.Context, shared1.GetIndexersOptions) ([]string, error) - hooks []func(context.Context, shared1.GetIndexersOptions) ([]string, error) - history []StoreGetIndexersFuncCall - mutex sync.Mutex -} - -// GetIndexers delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetIndexers(v0 context.Context, v1 shared1.GetIndexersOptions) ([]string, error) { - r0, r1 := m.GetIndexersFunc.nextHook()(v0, v1) - m.GetIndexersFunc.appendCall(StoreGetIndexersFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetIndexers method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetIndexersFunc) SetDefaultHook(hook func(context.Context, shared1.GetIndexersOptions) ([]string, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetIndexers method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetIndexersFunc) PushHook(hook func(context.Context, shared1.GetIndexersOptions) ([]string, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetIndexersFunc) SetDefaultReturn(r0 []string, r1 error) { - f.SetDefaultHook(func(context.Context, shared1.GetIndexersOptions) ([]string, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetIndexersFunc) PushReturn(r0 []string, r1 error) { - f.PushHook(func(context.Context, shared1.GetIndexersOptions) ([]string, error) { - return r0, r1 - }) -} - -func (f *StoreGetIndexersFunc) nextHook() func(context.Context, shared1.GetIndexersOptions) ([]string, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetIndexersFunc) appendCall(r0 StoreGetIndexersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetIndexersFuncCall objects describing -// the invocations of this function. -func (f *StoreGetIndexersFunc) History() []StoreGetIndexersFuncCall { - f.mutex.Lock() - history := make([]StoreGetIndexersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetIndexersFuncCall is an object that describes an invocation of -// method GetIndexers on an instance of MockStore. -type StoreGetIndexersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.GetIndexersOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []string - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetIndexersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetIndexersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetLastUploadRetentionScanForRepositoryFunc describes the behavior -// when the GetLastUploadRetentionScanForRepository method of the parent -// MockStore instance is invoked. -type StoreGetLastUploadRetentionScanForRepositoryFunc struct { - defaultHook func(context.Context, int) (*time.Time, error) - hooks []func(context.Context, int) (*time.Time, error) - history []StoreGetLastUploadRetentionScanForRepositoryFuncCall - mutex sync.Mutex -} - -// GetLastUploadRetentionScanForRepository delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) GetLastUploadRetentionScanForRepository(v0 context.Context, v1 int) (*time.Time, error) { - r0, r1 := m.GetLastUploadRetentionScanForRepositoryFunc.nextHook()(v0, v1) - m.GetLastUploadRetentionScanForRepositoryFunc.appendCall(StoreGetLastUploadRetentionScanForRepositoryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetLastUploadRetentionScanForRepository method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) SetDefaultHook(hook func(context.Context, int) (*time.Time, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetLastUploadRetentionScanForRepository method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) PushHook(hook func(context.Context, int) (*time.Time, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) SetDefaultReturn(r0 *time.Time, r1 error) { - f.SetDefaultHook(func(context.Context, int) (*time.Time, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) PushReturn(r0 *time.Time, r1 error) { - f.PushHook(func(context.Context, int) (*time.Time, error) { - return r0, r1 - }) -} - -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) nextHook() func(context.Context, int) (*time.Time, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) appendCall(r0 StoreGetLastUploadRetentionScanForRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetLastUploadRetentionScanForRepositoryFuncCall objects describing -// the invocations of this function. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) History() []StoreGetLastUploadRetentionScanForRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreGetLastUploadRetentionScanForRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetLastUploadRetentionScanForRepositoryFuncCall is an object that -// describes an invocation of method GetLastUploadRetentionScanForRepository -// on an instance of MockStore. -type StoreGetLastUploadRetentionScanForRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 *time.Time - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetLastUploadRetentionScanForRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetLastUploadRetentionScanForRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRecentAutoIndexJobsSummaryFunc describes the behavior when the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance is -// invoked. -type StoreGetRecentAutoIndexJobsSummaryFunc struct { - defaultHook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) - hooks []func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) - history []StoreGetRecentAutoIndexJobsSummaryFuncCall - mutex sync.Mutex -} - -// GetRecentAutoIndexJobsSummary delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetRecentAutoIndexJobsSummary(v0 context.Context, v1 int) ([]shared1.GroupedAutoIndexJobs, error) { - r0, r1 := m.GetRecentAutoIndexJobsSummaryFunc.nextHook()(v0, v1) - m.GetRecentAutoIndexJobsSummaryFunc.appendCall(StoreGetRecentAutoIndexJobsSummaryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) SetDefaultReturn(r0 []shared1.GroupedAutoIndexJobs, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) PushReturn(r0 []shared1.GroupedAutoIndexJobs, r1 error) { - f.PushHook(func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) { - return r0, r1 - }) -} - -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) nextHook() func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) appendCall(r0 StoreGetRecentAutoIndexJobsSummaryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRecentAutoIndexJobsSummaryFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) History() []StoreGetRecentAutoIndexJobsSummaryFuncCall { - f.mutex.Lock() - history := make([]StoreGetRecentAutoIndexJobsSummaryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRecentAutoIndexJobsSummaryFuncCall is an object that describes an -// invocation of method GetRecentAutoIndexJobsSummary on an instance of -// MockStore. -type StoreGetRecentAutoIndexJobsSummaryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.GroupedAutoIndexJobs - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRecentAutoIndexJobsSummaryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRecentAutoIndexJobsSummaryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRecentUploadsSummaryFunc describes the behavior when the -// GetRecentUploadsSummary method of the parent MockStore instance is -// invoked. -type StoreGetRecentUploadsSummaryFunc struct { - defaultHook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) - hooks []func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) - history []StoreGetRecentUploadsSummaryFuncCall - mutex sync.Mutex -} - -// GetRecentUploadsSummary delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetRecentUploadsSummary(v0 context.Context, v1 int) ([]shared1.UploadsWithRepositoryNamespace, error) { - r0, r1 := m.GetRecentUploadsSummaryFunc.nextHook()(v0, v1) - m.GetRecentUploadsSummaryFunc.appendCall(StoreGetRecentUploadsSummaryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRecentUploadsSummary method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRecentUploadsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRecentUploadsSummary method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetRecentUploadsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRecentUploadsSummaryFunc) SetDefaultReturn(r0 []shared1.UploadsWithRepositoryNamespace, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRecentUploadsSummaryFunc) PushReturn(r0 []shared1.UploadsWithRepositoryNamespace, r1 error) { - f.PushHook(func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) { - return r0, r1 - }) -} - -func (f *StoreGetRecentUploadsSummaryFunc) nextHook() func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRecentUploadsSummaryFunc) appendCall(r0 StoreGetRecentUploadsSummaryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRecentUploadsSummaryFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRecentUploadsSummaryFunc) History() []StoreGetRecentUploadsSummaryFuncCall { - f.mutex.Lock() - history := make([]StoreGetRecentUploadsSummaryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRecentUploadsSummaryFuncCall is an object that describes an -// invocation of method GetRecentUploadsSummary on an instance of MockStore. -type StoreGetRecentUploadsSummaryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.UploadsWithRepositoryNamespace - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRecentUploadsSummaryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRecentUploadsSummaryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRepositoriesMaxStaleAgeFunc describes the behavior when the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance is -// invoked. -type StoreGetRepositoriesMaxStaleAgeFunc struct { - defaultHook func(context.Context) (time.Duration, error) - hooks []func(context.Context) (time.Duration, error) - history []StoreGetRepositoriesMaxStaleAgeFuncCall - mutex sync.Mutex -} - -// GetRepositoriesMaxStaleAge delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetRepositoriesMaxStaleAge(v0 context.Context) (time.Duration, error) { - r0, r1 := m.GetRepositoriesMaxStaleAgeFunc.nextHook()(v0) - m.GetRepositoriesMaxStaleAgeFunc.appendCall(StoreGetRepositoriesMaxStaleAgeFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) SetDefaultHook(hook func(context.Context) (time.Duration, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) PushHook(hook func(context.Context) (time.Duration, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) SetDefaultReturn(r0 time.Duration, r1 error) { - f.SetDefaultHook(func(context.Context) (time.Duration, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) PushReturn(r0 time.Duration, r1 error) { - f.PushHook(func(context.Context) (time.Duration, error) { - return r0, r1 - }) -} - -func (f *StoreGetRepositoriesMaxStaleAgeFunc) nextHook() func(context.Context) (time.Duration, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRepositoriesMaxStaleAgeFunc) appendCall(r0 StoreGetRepositoriesMaxStaleAgeFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRepositoriesMaxStaleAgeFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) History() []StoreGetRepositoriesMaxStaleAgeFuncCall { - f.mutex.Lock() - history := make([]StoreGetRepositoriesMaxStaleAgeFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRepositoriesMaxStaleAgeFuncCall is an object that describes an -// invocation of method GetRepositoriesMaxStaleAge on an instance of -// MockStore. -type StoreGetRepositoriesMaxStaleAgeFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 time.Duration - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRepositoriesMaxStaleAgeFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRepositoriesMaxStaleAgeFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetUploadByIDFunc describes the behavior when the GetUploadByID -// method of the parent MockStore instance is invoked. -type StoreGetUploadByIDFunc struct { - defaultHook func(context.Context, int) (shared1.Upload, bool, error) - hooks []func(context.Context, int) (shared1.Upload, bool, error) - history []StoreGetUploadByIDFuncCall - mutex sync.Mutex -} - -// GetUploadByID delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetUploadByID(v0 context.Context, v1 int) (shared1.Upload, bool, error) { - r0, r1, r2 := m.GetUploadByIDFunc.nextHook()(v0, v1) - m.GetUploadByIDFunc.appendCall(StoreGetUploadByIDFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetUploadByID method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (shared1.Upload, bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadByID method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadByIDFunc) PushHook(hook func(context.Context, int) (shared1.Upload, bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadByIDFunc) SetDefaultReturn(r0 shared1.Upload, r1 bool, r2 error) { - f.SetDefaultHook(func(context.Context, int) (shared1.Upload, bool, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadByIDFunc) PushReturn(r0 shared1.Upload, r1 bool, r2 error) { - f.PushHook(func(context.Context, int) (shared1.Upload, bool, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetUploadByIDFunc) nextHook() func(context.Context, int) (shared1.Upload, bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadByIDFunc) appendCall(r0 StoreGetUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreGetUploadByIDFunc) History() []StoreGetUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadByIDFuncCall is an object that describes an invocation of -// method GetUploadByID on an instance of MockStore. -type StoreGetUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared1.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 bool - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetUploadIDsWithReferencesFunc describes the behavior when the -// GetUploadIDsWithReferences method of the parent MockStore instance is -// invoked. -type StoreGetUploadIDsWithReferencesFunc struct { - defaultHook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) - hooks []func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) - history []StoreGetUploadIDsWithReferencesFuncCall - mutex sync.Mutex -} - -// GetUploadIDsWithReferences delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadIDsWithReferences(v0 context.Context, v1 []precise.QualifiedMonikerData, v2 []int, v3 int, v4 string, v5 int, v6 int, v7 observation.TraceLogger) ([]int, int, int, error) { - r0, r1, r2, r3 := m.GetUploadIDsWithReferencesFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6, v7) - m.GetUploadIDsWithReferencesFunc.appendCall(StoreGetUploadIDsWithReferencesFuncCall{v0, v1, v2, v3, v4, v5, v6, v7, r0, r1, r2, r3}) - return r0, r1, r2, r3 -} - -// SetDefaultHook sets function that is called when the -// GetUploadIDsWithReferences method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetUploadIDsWithReferencesFunc) SetDefaultHook(hook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadIDsWithReferences method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetUploadIDsWithReferencesFunc) PushHook(hook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadIDsWithReferencesFunc) SetDefaultReturn(r0 []int, r1 int, r2 int, r3 error) { - f.SetDefaultHook(func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - return r0, r1, r2, r3 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadIDsWithReferencesFunc) PushReturn(r0 []int, r1 int, r2 int, r3 error) { - f.PushHook(func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - return r0, r1, r2, r3 - }) -} - -func (f *StoreGetUploadIDsWithReferencesFunc) nextHook() func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadIDsWithReferencesFunc) appendCall(r0 StoreGetUploadIDsWithReferencesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadIDsWithReferencesFuncCall -// objects describing the invocations of this function. -func (f *StoreGetUploadIDsWithReferencesFunc) History() []StoreGetUploadIDsWithReferencesFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadIDsWithReferencesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadIDsWithReferencesFuncCall is an object that describes an -// invocation of method GetUploadIDsWithReferences on an instance of -// MockStore. -type StoreGetUploadIDsWithReferencesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []precise.QualifiedMonikerData - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 int - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 string - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 int - // Arg6 is the value of the 7th argument passed to this method - // invocation. - Arg6 int - // Arg7 is the value of the 8th argument passed to this method - // invocation. - Arg7 observation.TraceLogger - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 int - // Result3 is the value of the 4th result returned from this method - // invocation. - Result3 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadIDsWithReferencesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5, c.Arg6, c.Arg7} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadIDsWithReferencesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2, c.Result3} -} - -// StoreGetUploadsFunc describes the behavior when the GetUploads method of -// the parent MockStore instance is invoked. -type StoreGetUploadsFunc struct { - defaultHook func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) - hooks []func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) - history []StoreGetUploadsFuncCall - mutex sync.Mutex -} - -// GetUploads delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetUploads(v0 context.Context, v1 shared1.GetUploadsOptions) ([]shared1.Upload, int, error) { - r0, r1, r2 := m.GetUploadsFunc.nextHook()(v0, v1) - m.GetUploadsFunc.appendCall(StoreGetUploadsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetUploads method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploads method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadsFunc) PushHook(hook func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsFunc) SetDefaultReturn(r0 []shared1.Upload, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsFunc) PushReturn(r0 []shared1.Upload, r1 int, r2 error) { - f.PushHook(func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetUploadsFunc) nextHook() func(context.Context, shared1.GetUploadsOptions) ([]shared1.Upload, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsFunc) appendCall(r0 StoreGetUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsFuncCall objects describing -// the invocations of this function. -func (f *StoreGetUploadsFunc) History() []StoreGetUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsFuncCall is an object that describes an invocation of -// method GetUploads on an instance of MockStore. -type StoreGetUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.GetUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetUploadsByIDsFunc describes the behavior when the GetUploadsByIDs -// method of the parent MockStore instance is invoked. -type StoreGetUploadsByIDsFunc struct { - defaultHook func(context.Context, ...int) ([]shared1.Upload, error) - hooks []func(context.Context, ...int) ([]shared1.Upload, error) - history []StoreGetUploadsByIDsFuncCall - mutex sync.Mutex -} - -// GetUploadsByIDs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadsByIDs(v0 context.Context, v1 ...int) ([]shared1.Upload, error) { - r0, r1 := m.GetUploadsByIDsFunc.nextHook()(v0, v1...) - m.GetUploadsByIDsFunc.appendCall(StoreGetUploadsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetUploadsByIDs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared1.Upload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadsByIDs method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadsByIDsFunc) PushHook(hook func(context.Context, ...int) ([]shared1.Upload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsByIDsFunc) SetDefaultReturn(r0 []shared1.Upload, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared1.Upload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsByIDsFunc) PushReturn(r0 []shared1.Upload, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared1.Upload, error) { - return r0, r1 - }) -} - -func (f *StoreGetUploadsByIDsFunc) nextHook() func(context.Context, ...int) ([]shared1.Upload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsByIDsFunc) appendCall(r0 StoreGetUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetUploadsByIDsFunc) History() []StoreGetUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsByIDsFuncCall is an object that describes an invocation of -// method GetUploadsByIDs on an instance of MockStore. -type StoreGetUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetUploadsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetUploadsByIDsAllowDeletedFunc describes the behavior when the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance is -// invoked. -type StoreGetUploadsByIDsAllowDeletedFunc struct { - defaultHook func(context.Context, ...int) ([]shared1.Upload, error) - hooks []func(context.Context, ...int) ([]shared1.Upload, error) - history []StoreGetUploadsByIDsAllowDeletedFuncCall - mutex sync.Mutex -} - -// GetUploadsByIDsAllowDeleted delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadsByIDsAllowDeleted(v0 context.Context, v1 ...int) ([]shared1.Upload, error) { - r0, r1 := m.GetUploadsByIDsAllowDeletedFunc.nextHook()(v0, v1...) - m.GetUploadsByIDsAllowDeletedFunc.appendCall(StoreGetUploadsByIDsAllowDeletedFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared1.Upload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) PushHook(hook func(context.Context, ...int) ([]shared1.Upload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) SetDefaultReturn(r0 []shared1.Upload, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared1.Upload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) PushReturn(r0 []shared1.Upload, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared1.Upload, error) { - return r0, r1 - }) -} - -func (f *StoreGetUploadsByIDsAllowDeletedFunc) nextHook() func(context.Context, ...int) ([]shared1.Upload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsByIDsAllowDeletedFunc) appendCall(r0 StoreGetUploadsByIDsAllowDeletedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsByIDsAllowDeletedFuncCall -// objects describing the invocations of this function. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) History() []StoreGetUploadsByIDsAllowDeletedFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsByIDsAllowDeletedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsByIDsAllowDeletedFuncCall is an object that describes an -// invocation of method GetUploadsByIDsAllowDeleted on an instance of -// MockStore. -type StoreGetUploadsByIDsAllowDeletedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetUploadsByIDsAllowDeletedFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsByIDsAllowDeletedFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetVisibleUploadsMatchingMonikersFunc describes the behavior when -// the GetVisibleUploadsMatchingMonikers method of the parent MockStore -// instance is invoked. -type StoreGetVisibleUploadsMatchingMonikersFunc struct { - defaultHook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) - hooks []func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) - history []StoreGetVisibleUploadsMatchingMonikersFuncCall - mutex sync.Mutex -} - -// GetVisibleUploadsMatchingMonikers delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetVisibleUploadsMatchingMonikers(v0 context.Context, v1 int, v2 string, v3 []precise.QualifiedMonikerData, v4 int, v5 int) (shared1.PackageReferenceScanner, int, error) { - r0, r1, r2 := m.GetVisibleUploadsMatchingMonikersFunc.nextHook()(v0, v1, v2, v3, v4, v5) - m.GetVisibleUploadsMatchingMonikersFunc.appendCall(StoreGetVisibleUploadsMatchingMonikersFuncCall{v0, v1, v2, v3, v4, v5, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetVisibleUploadsMatchingMonikers method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) SetDefaultHook(hook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetVisibleUploadsMatchingMonikers method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) PushHook(hook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) SetDefaultReturn(r0 shared1.PackageReferenceScanner, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) PushReturn(r0 shared1.PackageReferenceScanner, r1 int, r2 error) { - f.PushHook(func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) nextHook() func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared1.PackageReferenceScanner, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) appendCall(r0 StoreGetVisibleUploadsMatchingMonikersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetVisibleUploadsMatchingMonikersFuncCall objects describing the -// invocations of this function. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) History() []StoreGetVisibleUploadsMatchingMonikersFuncCall { - f.mutex.Lock() - history := make([]StoreGetVisibleUploadsMatchingMonikersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetVisibleUploadsMatchingMonikersFuncCall is an object that -// describes an invocation of method GetVisibleUploadsMatchingMonikers on an -// instance of MockStore. -type StoreGetVisibleUploadsMatchingMonikersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 []precise.QualifiedMonikerData - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 int - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared1.PackageReferenceScanner - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetVisibleUploadsMatchingMonikersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetVisibleUploadsMatchingMonikersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreHandleFunc describes the behavior when the Handle method of the -// parent MockStore instance is invoked. -type StoreHandleFunc struct { - defaultHook func() *basestore.Store - hooks []func() *basestore.Store - history []StoreHandleFuncCall - mutex sync.Mutex -} - -// Handle delegates to the next hook function in the queue and stores the -// parameter and result values of this invocation. -func (m *MockStore) Handle() *basestore.Store { - r0 := m.HandleFunc.nextHook()() - m.HandleFunc.appendCall(StoreHandleFuncCall{r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the Handle method of the -// parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHandleFunc) SetDefaultHook(hook func() *basestore.Store) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// Handle method of the parent MockStore instance invokes the hook at the -// front of the queue and discards it. After the queue is empty, the default -// hook function is invoked for any future action. -func (f *StoreHandleFunc) PushHook(hook func() *basestore.Store) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHandleFunc) SetDefaultReturn(r0 *basestore.Store) { - f.SetDefaultHook(func() *basestore.Store { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHandleFunc) PushReturn(r0 *basestore.Store) { - f.PushHook(func() *basestore.Store { - return r0 - }) -} - -func (f *StoreHandleFunc) nextHook() func() *basestore.Store { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHandleFunc) appendCall(r0 StoreHandleFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHandleFuncCall objects describing the -// invocations of this function. -func (f *StoreHandleFunc) History() []StoreHandleFuncCall { - f.mutex.Lock() - history := make([]StoreHandleFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHandleFuncCall is an object that describes an invocation of method -// Handle on an instance of MockStore. -type StoreHandleFuncCall struct { - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 *basestore.Store -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHandleFuncCall) Args() []interface{} { - return []interface{}{} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHandleFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreHardDeleteUploadsByIDsFunc describes the behavior when the -// HardDeleteUploadsByIDs method of the parent MockStore instance is -// invoked. -type StoreHardDeleteUploadsByIDsFunc struct { - defaultHook func(context.Context, ...int) error - hooks []func(context.Context, ...int) error - history []StoreHardDeleteUploadsByIDsFuncCall - mutex sync.Mutex -} - -// HardDeleteUploadsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) HardDeleteUploadsByIDs(v0 context.Context, v1 ...int) error { - r0 := m.HardDeleteUploadsByIDsFunc.nextHook()(v0, v1...) - m.HardDeleteUploadsByIDsFunc.appendCall(StoreHardDeleteUploadsByIDsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// HardDeleteUploadsByIDs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreHardDeleteUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HardDeleteUploadsByIDs method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreHardDeleteUploadsByIDsFunc) PushHook(hook func(context.Context, ...int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHardDeleteUploadsByIDsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, ...int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHardDeleteUploadsByIDsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, ...int) error { - return r0 - }) -} - -func (f *StoreHardDeleteUploadsByIDsFunc) nextHook() func(context.Context, ...int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHardDeleteUploadsByIDsFunc) appendCall(r0 StoreHardDeleteUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHardDeleteUploadsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreHardDeleteUploadsByIDsFunc) History() []StoreHardDeleteUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreHardDeleteUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHardDeleteUploadsByIDsFuncCall is an object that describes an -// invocation of method HardDeleteUploadsByIDs on an instance of MockStore. -type StoreHardDeleteUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreHardDeleteUploadsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHardDeleteUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreHasCommitFunc describes the behavior when the HasCommit method of -// the parent MockStore instance is invoked. -type StoreHasCommitFunc struct { - defaultHook func(context.Context, api.RepoID, api.CommitID) (bool, error) - hooks []func(context.Context, api.RepoID, api.CommitID) (bool, error) - history []StoreHasCommitFuncCall - mutex sync.Mutex -} - -// HasCommit delegates to the next hook function in the queue and stores the -// parameter and result values of this invocation. -func (m *MockStore) HasCommit(v0 context.Context, v1 api.RepoID, v2 api.CommitID) (bool, error) { - r0, r1 := m.HasCommitFunc.nextHook()(v0, v1, v2) - m.HasCommitFunc.appendCall(StoreHasCommitFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the HasCommit method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHasCommitFunc) SetDefaultHook(hook func(context.Context, api.RepoID, api.CommitID) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HasCommit method of the parent MockStore instance invokes the hook at the -// front of the queue and discards it. After the queue is empty, the default -// hook function is invoked for any future action. -func (f *StoreHasCommitFunc) PushHook(hook func(context.Context, api.RepoID, api.CommitID) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHasCommitFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, api.RepoID, api.CommitID) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHasCommitFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, api.RepoID, api.CommitID) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreHasCommitFunc) nextHook() func(context.Context, api.RepoID, api.CommitID) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHasCommitFunc) appendCall(r0 StoreHasCommitFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHasCommitFuncCall objects describing -// the invocations of this function. -func (f *StoreHasCommitFunc) History() []StoreHasCommitFuncCall { - f.mutex.Lock() - history := make([]StoreHasCommitFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHasCommitFuncCall is an object that describes an invocation of -// method HasCommit on an instance of MockStore. -type StoreHasCommitFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 api.RepoID - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 api.CommitID - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHasCommitFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHasCommitFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreHasRepositoryFunc describes the behavior when the HasRepository -// method of the parent MockStore instance is invoked. -type StoreHasRepositoryFunc struct { - defaultHook func(context.Context, api.RepoID) (bool, error) - hooks []func(context.Context, api.RepoID) (bool, error) - history []StoreHasRepositoryFuncCall - mutex sync.Mutex -} - -// HasRepository delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) HasRepository(v0 context.Context, v1 api.RepoID) (bool, error) { - r0, r1 := m.HasRepositoryFunc.nextHook()(v0, v1) - m.HasRepositoryFunc.appendCall(StoreHasRepositoryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the HasRepository method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHasRepositoryFunc) SetDefaultHook(hook func(context.Context, api.RepoID) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HasRepository method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreHasRepositoryFunc) PushHook(hook func(context.Context, api.RepoID) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHasRepositoryFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, api.RepoID) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHasRepositoryFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, api.RepoID) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreHasRepositoryFunc) nextHook() func(context.Context, api.RepoID) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHasRepositoryFunc) appendCall(r0 StoreHasRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHasRepositoryFuncCall objects -// describing the invocations of this function. -func (f *StoreHasRepositoryFunc) History() []StoreHasRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreHasRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHasRepositoryFuncCall is an object that describes an invocation of -// method HasRepository on an instance of MockStore. -type StoreHasRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 api.RepoID - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHasRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHasRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreInsertDependencySyncingJobFunc describes the behavior when the -// InsertDependencySyncingJob method of the parent MockStore instance is -// invoked. -type StoreInsertDependencySyncingJobFunc struct { - defaultHook func(context.Context, int) (int, error) - hooks []func(context.Context, int) (int, error) - history []StoreInsertDependencySyncingJobFuncCall - mutex sync.Mutex -} - -// InsertDependencySyncingJob delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) InsertDependencySyncingJob(v0 context.Context, v1 int) (int, error) { - r0, r1 := m.InsertDependencySyncingJobFunc.nextHook()(v0, v1) - m.InsertDependencySyncingJobFunc.appendCall(StoreInsertDependencySyncingJobFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// InsertDependencySyncingJob method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreInsertDependencySyncingJobFunc) SetDefaultHook(hook func(context.Context, int) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// InsertDependencySyncingJob method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreInsertDependencySyncingJobFunc) PushHook(hook func(context.Context, int) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreInsertDependencySyncingJobFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, int) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreInsertDependencySyncingJobFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, int) (int, error) { - return r0, r1 - }) -} - -func (f *StoreInsertDependencySyncingJobFunc) nextHook() func(context.Context, int) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreInsertDependencySyncingJobFunc) appendCall(r0 StoreInsertDependencySyncingJobFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreInsertDependencySyncingJobFuncCall -// objects describing the invocations of this function. -func (f *StoreInsertDependencySyncingJobFunc) History() []StoreInsertDependencySyncingJobFuncCall { - f.mutex.Lock() - history := make([]StoreInsertDependencySyncingJobFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreInsertDependencySyncingJobFuncCall is an object that describes an -// invocation of method InsertDependencySyncingJob on an instance of -// MockStore. -type StoreInsertDependencySyncingJobFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreInsertDependencySyncingJobFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreInsertDependencySyncingJobFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreInsertUploadFunc describes the behavior when the InsertUpload method -// of the parent MockStore instance is invoked. -type StoreInsertUploadFunc struct { - defaultHook func(context.Context, shared1.Upload) (int, error) - hooks []func(context.Context, shared1.Upload) (int, error) - history []StoreInsertUploadFuncCall - mutex sync.Mutex -} - -// InsertUpload delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) InsertUpload(v0 context.Context, v1 shared1.Upload) (int, error) { - r0, r1 := m.InsertUploadFunc.nextHook()(v0, v1) - m.InsertUploadFunc.appendCall(StoreInsertUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the InsertUpload method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreInsertUploadFunc) SetDefaultHook(hook func(context.Context, shared1.Upload) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// InsertUpload method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreInsertUploadFunc) PushHook(hook func(context.Context, shared1.Upload) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreInsertUploadFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, shared1.Upload) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreInsertUploadFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, shared1.Upload) (int, error) { - return r0, r1 - }) -} - -func (f *StoreInsertUploadFunc) nextHook() func(context.Context, shared1.Upload) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreInsertUploadFunc) appendCall(r0 StoreInsertUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreInsertUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreInsertUploadFunc) History() []StoreInsertUploadFuncCall { - f.mutex.Lock() - history := make([]StoreInsertUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreInsertUploadFuncCall is an object that describes an invocation of -// method InsertUpload on an instance of MockStore. -type StoreInsertUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.Upload - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreInsertUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreInsertUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreMarkFailedFunc describes the behavior when the MarkFailed method of -// the parent MockStore instance is invoked. -type StoreMarkFailedFunc struct { - defaultHook func(context.Context, int, string) error - hooks []func(context.Context, int, string) error - history []StoreMarkFailedFuncCall - mutex sync.Mutex -} - -// MarkFailed delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) MarkFailed(v0 context.Context, v1 int, v2 string) error { - r0 := m.MarkFailedFunc.nextHook()(v0, v1, v2) - m.MarkFailedFunc.appendCall(StoreMarkFailedFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the MarkFailed method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreMarkFailedFunc) SetDefaultHook(hook func(context.Context, int, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// MarkFailed method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreMarkFailedFunc) PushHook(hook func(context.Context, int, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreMarkFailedFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreMarkFailedFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string) error { - return r0 - }) -} - -func (f *StoreMarkFailedFunc) nextHook() func(context.Context, int, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreMarkFailedFunc) appendCall(r0 StoreMarkFailedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreMarkFailedFuncCall objects describing -// the invocations of this function. -func (f *StoreMarkFailedFunc) History() []StoreMarkFailedFuncCall { - f.mutex.Lock() - history := make([]StoreMarkFailedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreMarkFailedFuncCall is an object that describes an invocation of -// method MarkFailed on an instance of MockStore. -type StoreMarkFailedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreMarkFailedFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreMarkFailedFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreMarkQueuedFunc describes the behavior when the MarkQueued method of -// the parent MockStore instance is invoked. -type StoreMarkQueuedFunc struct { - defaultHook func(context.Context, int, *int64) error - hooks []func(context.Context, int, *int64) error - history []StoreMarkQueuedFuncCall - mutex sync.Mutex -} - -// MarkQueued delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) MarkQueued(v0 context.Context, v1 int, v2 *int64) error { - r0 := m.MarkQueuedFunc.nextHook()(v0, v1, v2) - m.MarkQueuedFunc.appendCall(StoreMarkQueuedFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the MarkQueued method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreMarkQueuedFunc) SetDefaultHook(hook func(context.Context, int, *int64) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// MarkQueued method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreMarkQueuedFunc) PushHook(hook func(context.Context, int, *int64) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreMarkQueuedFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, *int64) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreMarkQueuedFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, *int64) error { - return r0 - }) -} - -func (f *StoreMarkQueuedFunc) nextHook() func(context.Context, int, *int64) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreMarkQueuedFunc) appendCall(r0 StoreMarkQueuedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreMarkQueuedFuncCall objects describing -// the invocations of this function. -func (f *StoreMarkQueuedFunc) History() []StoreMarkQueuedFuncCall { - f.mutex.Lock() - history := make([]StoreMarkQueuedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreMarkQueuedFuncCall is an object that describes an invocation of -// method MarkQueued on an instance of MockStore. -type StoreMarkQueuedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *int64 - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreMarkQueuedFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreMarkQueuedFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreNumRepositoriesWithCodeIntelligenceFunc describes the behavior when -// the NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance is invoked. -type StoreNumRepositoriesWithCodeIntelligenceFunc struct { - defaultHook func(context.Context) (int, error) - hooks []func(context.Context) (int, error) - history []StoreNumRepositoriesWithCodeIntelligenceFuncCall - mutex sync.Mutex -} - -// NumRepositoriesWithCodeIntelligence delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) NumRepositoriesWithCodeIntelligence(v0 context.Context) (int, error) { - r0, r1 := m.NumRepositoriesWithCodeIntelligenceFunc.nextHook()(v0) - m.NumRepositoriesWithCodeIntelligenceFunc.appendCall(StoreNumRepositoriesWithCodeIntelligenceFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) SetDefaultHook(hook func(context.Context) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) PushHook(hook func(context.Context) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context) (int, error) { - return r0, r1 - }) -} - -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) nextHook() func(context.Context) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) appendCall(r0 StoreNumRepositoriesWithCodeIntelligenceFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreNumRepositoriesWithCodeIntelligenceFuncCall objects describing the -// invocations of this function. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) History() []StoreNumRepositoriesWithCodeIntelligenceFuncCall { - f.mutex.Lock() - history := make([]StoreNumRepositoriesWithCodeIntelligenceFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreNumRepositoriesWithCodeIntelligenceFuncCall is an object that -// describes an invocation of method NumRepositoriesWithCodeIntelligence on -// an instance of MockStore. -type StoreNumRepositoriesWithCodeIntelligenceFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreNumRepositoriesWithCodeIntelligenceFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreNumRepositoriesWithCodeIntelligenceFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreProcessSourcedCommitsFunc describes the behavior when the -// ProcessSourcedCommits method of the parent MockStore instance is invoked. -type StoreProcessSourcedCommitsFunc struct { - defaultHook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) - hooks []func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) - history []StoreProcessSourcedCommitsFuncCall - mutex sync.Mutex -} - -// ProcessSourcedCommits delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) ProcessSourcedCommits(v0 context.Context, v1 time.Duration, v2 time.Duration, v3 int, v4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), v5 time.Time) (int, int, error) { - r0, r1, r2 := m.ProcessSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4, v5) - m.ProcessSourcedCommitsFunc.appendCall(StoreProcessSourcedCommitsFuncCall{v0, v1, v2, v3, v4, v5, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// ProcessSourcedCommits method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreProcessSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ProcessSourcedCommits method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreProcessSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreProcessSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreProcessSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreProcessSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreProcessSourcedCommitsFunc) appendCall(r0 StoreProcessSourcedCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreProcessSourcedCommitsFuncCall objects -// describing the invocations of this function. -func (f *StoreProcessSourcedCommitsFunc) History() []StoreProcessSourcedCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreProcessSourcedCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreProcessSourcedCommitsFuncCall is an object that describes an -// invocation of method ProcessSourcedCommits on an instance of MockStore. -type StoreProcessSourcedCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Duration - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 int - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error) - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreProcessSourcedCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreProcessSourcedCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreProcessStaleSourcedCommitsFunc describes the behavior when the -// ProcessStaleSourcedCommits method of the parent MockStore instance is -// invoked. -type StoreProcessStaleSourcedCommitsFunc struct { - defaultHook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) - hooks []func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) - history []StoreProcessStaleSourcedCommitsFuncCall - mutex sync.Mutex -} - -// ProcessStaleSourcedCommits delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) ProcessStaleSourcedCommits(v0 context.Context, v1 time.Duration, v2 int, v3 time.Duration, v4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - r0, r1, r2 := m.ProcessStaleSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4) - m.ProcessStaleSourcedCommitsFunc.appendCall(StoreProcessStaleSourcedCommitsFuncCall{v0, v1, v2, v3, v4, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// ProcessStaleSourcedCommits method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreProcessStaleSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ProcessStaleSourcedCommits method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreProcessStaleSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreProcessStaleSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreProcessStaleSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreProcessStaleSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreProcessStaleSourcedCommitsFunc) appendCall(r0 StoreProcessStaleSourcedCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreProcessStaleSourcedCommitsFuncCall -// objects describing the invocations of this function. -func (f *StoreProcessStaleSourcedCommitsFunc) History() []StoreProcessStaleSourcedCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreProcessStaleSourcedCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreProcessStaleSourcedCommitsFuncCall is an object that describes an -// invocation of method ProcessStaleSourcedCommits on an instance of -// MockStore. -type StoreProcessStaleSourcedCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 time.Duration - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error) - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreProcessStaleSourcedCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreProcessStaleSourcedCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreReconcileCandidatesFunc describes the behavior when the -// ReconcileCandidates method of the parent MockStore instance is invoked. -type StoreReconcileCandidatesFunc struct { - defaultHook func(context.Context, int) ([]int, error) - hooks []func(context.Context, int) ([]int, error) - history []StoreReconcileCandidatesFuncCall - mutex sync.Mutex -} - -// ReconcileCandidates delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReconcileCandidates(v0 context.Context, v1 int) ([]int, error) { - r0, r1 := m.ReconcileCandidatesFunc.nextHook()(v0, v1) - m.ReconcileCandidatesFunc.appendCall(StoreReconcileCandidatesFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the ReconcileCandidates -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReconcileCandidatesFunc) SetDefaultHook(hook func(context.Context, int) ([]int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReconcileCandidates method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReconcileCandidatesFunc) PushHook(hook func(context.Context, int) ([]int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReconcileCandidatesFunc) SetDefaultReturn(r0 []int, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReconcileCandidatesFunc) PushReturn(r0 []int, r1 error) { - f.PushHook(func(context.Context, int) ([]int, error) { - return r0, r1 - }) -} - -func (f *StoreReconcileCandidatesFunc) nextHook() func(context.Context, int) ([]int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReconcileCandidatesFunc) appendCall(r0 StoreReconcileCandidatesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReconcileCandidatesFuncCall objects -// describing the invocations of this function. -func (f *StoreReconcileCandidatesFunc) History() []StoreReconcileCandidatesFuncCall { - f.mutex.Lock() - history := make([]StoreReconcileCandidatesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReconcileCandidatesFuncCall is an object that describes an -// invocation of method ReconcileCandidates on an instance of MockStore. -type StoreReconcileCandidatesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReconcileCandidatesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReconcileCandidatesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreReferencesForUploadFunc describes the behavior when the -// ReferencesForUpload method of the parent MockStore instance is invoked. -type StoreReferencesForUploadFunc struct { - defaultHook func(context.Context, int) (shared1.PackageReferenceScanner, error) - hooks []func(context.Context, int) (shared1.PackageReferenceScanner, error) - history []StoreReferencesForUploadFuncCall - mutex sync.Mutex -} - -// ReferencesForUpload delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReferencesForUpload(v0 context.Context, v1 int) (shared1.PackageReferenceScanner, error) { - r0, r1 := m.ReferencesForUploadFunc.nextHook()(v0, v1) - m.ReferencesForUploadFunc.appendCall(StoreReferencesForUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the ReferencesForUpload -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReferencesForUploadFunc) SetDefaultHook(hook func(context.Context, int) (shared1.PackageReferenceScanner, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReferencesForUpload method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReferencesForUploadFunc) PushHook(hook func(context.Context, int) (shared1.PackageReferenceScanner, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReferencesForUploadFunc) SetDefaultReturn(r0 shared1.PackageReferenceScanner, r1 error) { - f.SetDefaultHook(func(context.Context, int) (shared1.PackageReferenceScanner, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReferencesForUploadFunc) PushReturn(r0 shared1.PackageReferenceScanner, r1 error) { - f.PushHook(func(context.Context, int) (shared1.PackageReferenceScanner, error) { - return r0, r1 - }) -} - -func (f *StoreReferencesForUploadFunc) nextHook() func(context.Context, int) (shared1.PackageReferenceScanner, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReferencesForUploadFunc) appendCall(r0 StoreReferencesForUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReferencesForUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreReferencesForUploadFunc) History() []StoreReferencesForUploadFuncCall { - f.mutex.Lock() - history := make([]StoreReferencesForUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReferencesForUploadFuncCall is an object that describes an -// invocation of method ReferencesForUpload on an instance of MockStore. -type StoreReferencesForUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared1.PackageReferenceScanner - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReferencesForUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReferencesForUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreReindexUploadByIDFunc describes the behavior when the -// ReindexUploadByID method of the parent MockStore instance is invoked. -type StoreReindexUploadByIDFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreReindexUploadByIDFuncCall - mutex sync.Mutex -} - -// ReindexUploadByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReindexUploadByID(v0 context.Context, v1 int) error { - r0 := m.ReindexUploadByIDFunc.nextHook()(v0, v1) - m.ReindexUploadByIDFunc.appendCall(StoreReindexUploadByIDFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the ReindexUploadByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReindexUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReindexUploadByID method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReindexUploadByIDFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReindexUploadByIDFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReindexUploadByIDFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreReindexUploadByIDFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReindexUploadByIDFunc) appendCall(r0 StoreReindexUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReindexUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreReindexUploadByIDFunc) History() []StoreReindexUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreReindexUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReindexUploadByIDFuncCall is an object that describes an invocation -// of method ReindexUploadByID on an instance of MockStore. -type StoreReindexUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReindexUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReindexUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreReindexUploadsFunc describes the behavior when the ReindexUploads -// method of the parent MockStore instance is invoked. -type StoreReindexUploadsFunc struct { - defaultHook func(context.Context, shared1.ReindexUploadsOptions) error - hooks []func(context.Context, shared1.ReindexUploadsOptions) error - history []StoreReindexUploadsFuncCall - mutex sync.Mutex -} - -// ReindexUploads delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReindexUploads(v0 context.Context, v1 shared1.ReindexUploadsOptions) error { - r0 := m.ReindexUploadsFunc.nextHook()(v0, v1) - m.ReindexUploadsFunc.appendCall(StoreReindexUploadsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the ReindexUploads -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReindexUploadsFunc) SetDefaultHook(hook func(context.Context, shared1.ReindexUploadsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReindexUploads method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreReindexUploadsFunc) PushHook(hook func(context.Context, shared1.ReindexUploadsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReindexUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared1.ReindexUploadsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReindexUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared1.ReindexUploadsOptions) error { - return r0 - }) -} - -func (f *StoreReindexUploadsFunc) nextHook() func(context.Context, shared1.ReindexUploadsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReindexUploadsFunc) appendCall(r0 StoreReindexUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReindexUploadsFuncCall objects -// describing the invocations of this function. -func (f *StoreReindexUploadsFunc) History() []StoreReindexUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreReindexUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReindexUploadsFuncCall is an object that describes an invocation of -// method ReindexUploads on an instance of MockStore. -type StoreReindexUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.ReindexUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReindexUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReindexUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreRepositoryIDsWithErrorsFunc describes the behavior when the -// RepositoryIDsWithErrors method of the parent MockStore instance is -// invoked. -type StoreRepositoryIDsWithErrorsFunc struct { - defaultHook func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) - hooks []func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) - history []StoreRepositoryIDsWithErrorsFuncCall - mutex sync.Mutex -} - -// RepositoryIDsWithErrors delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) RepositoryIDsWithErrors(v0 context.Context, v1 int, v2 int) ([]shared1.RepositoryWithCount, int, error) { - r0, r1, r2 := m.RepositoryIDsWithErrorsFunc.nextHook()(v0, v1, v2) - m.RepositoryIDsWithErrorsFunc.appendCall(StoreRepositoryIDsWithErrorsFuncCall{v0, v1, v2, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// RepositoryIDsWithErrors method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreRepositoryIDsWithErrorsFunc) SetDefaultHook(hook func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// RepositoryIDsWithErrors method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreRepositoryIDsWithErrorsFunc) PushHook(hook func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreRepositoryIDsWithErrorsFunc) SetDefaultReturn(r0 []shared1.RepositoryWithCount, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreRepositoryIDsWithErrorsFunc) PushReturn(r0 []shared1.RepositoryWithCount, r1 int, r2 error) { - f.PushHook(func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreRepositoryIDsWithErrorsFunc) nextHook() func(context.Context, int, int) ([]shared1.RepositoryWithCount, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreRepositoryIDsWithErrorsFunc) appendCall(r0 StoreRepositoryIDsWithErrorsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreRepositoryIDsWithErrorsFuncCall -// objects describing the invocations of this function. -func (f *StoreRepositoryIDsWithErrorsFunc) History() []StoreRepositoryIDsWithErrorsFuncCall { - f.mutex.Lock() - history := make([]StoreRepositoryIDsWithErrorsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreRepositoryIDsWithErrorsFuncCall is an object that describes an -// invocation of method RepositoryIDsWithErrors on an instance of MockStore. -type StoreRepositoryIDsWithErrorsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared1.RepositoryWithCount - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreRepositoryIDsWithErrorsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreRepositoryIDsWithErrorsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSetRepositoriesForRetentionScanFunc describes the behavior when the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// is invoked. -type StoreSetRepositoriesForRetentionScanFunc struct { - defaultHook func(context.Context, time.Duration, int) ([]int, error) - hooks []func(context.Context, time.Duration, int) ([]int, error) - history []StoreSetRepositoriesForRetentionScanFuncCall - mutex sync.Mutex -} - -// SetRepositoriesForRetentionScan delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) SetRepositoriesForRetentionScan(v0 context.Context, v1 time.Duration, v2 int) ([]int, error) { - r0, r1 := m.SetRepositoriesForRetentionScanFunc.nextHook()(v0, v1, v2) - m.SetRepositoriesForRetentionScanFunc.appendCall(StoreSetRepositoriesForRetentionScanFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreSetRepositoriesForRetentionScanFunc) SetDefaultHook(hook func(context.Context, time.Duration, int) ([]int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreSetRepositoriesForRetentionScanFunc) PushHook(hook func(context.Context, time.Duration, int) ([]int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRepositoriesForRetentionScanFunc) SetDefaultReturn(r0 []int, r1 error) { - f.SetDefaultHook(func(context.Context, time.Duration, int) ([]int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRepositoriesForRetentionScanFunc) PushReturn(r0 []int, r1 error) { - f.PushHook(func(context.Context, time.Duration, int) ([]int, error) { - return r0, r1 - }) -} - -func (f *StoreSetRepositoriesForRetentionScanFunc) nextHook() func(context.Context, time.Duration, int) ([]int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRepositoriesForRetentionScanFunc) appendCall(r0 StoreSetRepositoriesForRetentionScanFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSetRepositoriesForRetentionScanFuncCall objects describing the -// invocations of this function. -func (f *StoreSetRepositoriesForRetentionScanFunc) History() []StoreSetRepositoriesForRetentionScanFuncCall { - f.mutex.Lock() - history := make([]StoreSetRepositoriesForRetentionScanFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRepositoriesForRetentionScanFuncCall is an object that describes -// an invocation of method SetRepositoriesForRetentionScan on an instance of -// MockStore. -type StoreSetRepositoriesForRetentionScanFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRepositoriesForRetentionScanFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRepositoriesForRetentionScanFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreSetRepositoryAsDirtyFunc describes the behavior when the -// SetRepositoryAsDirty method of the parent MockStore instance is invoked. -type StoreSetRepositoryAsDirtyFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreSetRepositoryAsDirtyFuncCall - mutex sync.Mutex -} - -// SetRepositoryAsDirty delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) SetRepositoryAsDirty(v0 context.Context, v1 int) error { - r0 := m.SetRepositoryAsDirtyFunc.nextHook()(v0, v1) - m.SetRepositoryAsDirtyFunc.appendCall(StoreSetRepositoryAsDirtyFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the SetRepositoryAsDirty -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreSetRepositoryAsDirtyFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRepositoryAsDirty method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreSetRepositoryAsDirtyFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRepositoryAsDirtyFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRepositoryAsDirtyFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreSetRepositoryAsDirtyFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRepositoryAsDirtyFunc) appendCall(r0 StoreSetRepositoryAsDirtyFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRepositoryAsDirtyFuncCall objects -// describing the invocations of this function. -func (f *StoreSetRepositoryAsDirtyFunc) History() []StoreSetRepositoryAsDirtyFuncCall { - f.mutex.Lock() - history := make([]StoreSetRepositoryAsDirtyFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRepositoryAsDirtyFuncCall is an object that describes an -// invocation of method SetRepositoryAsDirty on an instance of MockStore. -type StoreSetRepositoryAsDirtyFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRepositoryAsDirtyFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRepositoryAsDirtyFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSetRerunAutoIndexJobByIDFunc describes the behavior when the -// SetRerunAutoIndexJobByID method of the parent MockStore instance is -// invoked. -type StoreSetRerunAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreSetRerunAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// SetRerunAutoIndexJobByID delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SetRerunAutoIndexJobByID(v0 context.Context, v1 int) error { - r0 := m.SetRerunAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.SetRerunAutoIndexJobByIDFunc.appendCall(StoreSetRerunAutoIndexJobByIDFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// SetRerunAutoIndexJobByID method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreSetRerunAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRerunAutoIndexJobByID method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreSetRerunAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRerunAutoIndexJobByIDFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRerunAutoIndexJobByIDFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreSetRerunAutoIndexJobByIDFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRerunAutoIndexJobByIDFunc) appendCall(r0 StoreSetRerunAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRerunAutoIndexJobByIDFuncCall -// objects describing the invocations of this function. -func (f *StoreSetRerunAutoIndexJobByIDFunc) History() []StoreSetRerunAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreSetRerunAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRerunAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method SetRerunAutoIndexJobByID on an instance of -// MockStore. -type StoreSetRerunAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRerunAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRerunAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSetRerunAutoIndexJobsFunc describes the behavior when the -// SetRerunAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreSetRerunAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error - hooks []func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error - history []StoreSetRerunAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// SetRerunAutoIndexJobs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SetRerunAutoIndexJobs(v0 context.Context, v1 shared1.SetRerunAutoIndexJobsOptions) error { - r0 := m.SetRerunAutoIndexJobsFunc.nextHook()(v0, v1) - m.SetRerunAutoIndexJobsFunc.appendCall(StoreSetRerunAutoIndexJobsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// SetRerunAutoIndexJobs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreSetRerunAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRerunAutoIndexJobs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreSetRerunAutoIndexJobsFunc) PushHook(hook func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRerunAutoIndexJobsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRerunAutoIndexJobsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error { - return r0 - }) -} - -func (f *StoreSetRerunAutoIndexJobsFunc) nextHook() func(context.Context, shared1.SetRerunAutoIndexJobsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRerunAutoIndexJobsFunc) appendCall(r0 StoreSetRerunAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRerunAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreSetRerunAutoIndexJobsFunc) History() []StoreSetRerunAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreSetRerunAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRerunAutoIndexJobsFuncCall is an object that describes an -// invocation of method SetRerunAutoIndexJobs on an instance of MockStore. -type StoreSetRerunAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared1.SetRerunAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRerunAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRerunAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSoftDeleteExpiredUploadsFunc describes the behavior when the -// SoftDeleteExpiredUploads method of the parent MockStore instance is -// invoked. -type StoreSoftDeleteExpiredUploadsFunc struct { - defaultHook func(context.Context, int) (int, int, error) - hooks []func(context.Context, int) (int, int, error) - history []StoreSoftDeleteExpiredUploadsFuncCall - mutex sync.Mutex -} - -// SoftDeleteExpiredUploads delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SoftDeleteExpiredUploads(v0 context.Context, v1 int) (int, int, error) { - r0, r1, r2 := m.SoftDeleteExpiredUploadsFunc.nextHook()(v0, v1) - m.SoftDeleteExpiredUploadsFunc.appendCall(StoreSoftDeleteExpiredUploadsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// SoftDeleteExpiredUploads method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreSoftDeleteExpiredUploadsFunc) SetDefaultHook(hook func(context.Context, int) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SoftDeleteExpiredUploads method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreSoftDeleteExpiredUploadsFunc) PushHook(hook func(context.Context, int) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSoftDeleteExpiredUploadsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSoftDeleteExpiredUploadsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreSoftDeleteExpiredUploadsFunc) nextHook() func(context.Context, int) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSoftDeleteExpiredUploadsFunc) appendCall(r0 StoreSoftDeleteExpiredUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSoftDeleteExpiredUploadsFuncCall -// objects describing the invocations of this function. -func (f *StoreSoftDeleteExpiredUploadsFunc) History() []StoreSoftDeleteExpiredUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreSoftDeleteExpiredUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSoftDeleteExpiredUploadsFuncCall is an object that describes an -// invocation of method SoftDeleteExpiredUploads on an instance of -// MockStore. -type StoreSoftDeleteExpiredUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSoftDeleteExpiredUploadsViaTraversalFunc describes the behavior when -// the SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance is invoked. -type StoreSoftDeleteExpiredUploadsViaTraversalFunc struct { - defaultHook func(context.Context, int) (int, int, error) - hooks []func(context.Context, int) (int, int, error) - history []StoreSoftDeleteExpiredUploadsViaTraversalFuncCall - mutex sync.Mutex -} - -// SoftDeleteExpiredUploadsViaTraversal delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) SoftDeleteExpiredUploadsViaTraversal(v0 context.Context, v1 int) (int, int, error) { - r0, r1, r2 := m.SoftDeleteExpiredUploadsViaTraversalFunc.nextHook()(v0, v1) - m.SoftDeleteExpiredUploadsViaTraversalFunc.appendCall(StoreSoftDeleteExpiredUploadsViaTraversalFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) SetDefaultHook(hook func(context.Context, int) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) PushHook(hook func(context.Context, int) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) nextHook() func(context.Context, int) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) appendCall(r0 StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSoftDeleteExpiredUploadsViaTraversalFuncCall objects describing the -// invocations of this function. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) History() []StoreSoftDeleteExpiredUploadsViaTraversalFuncCall { - f.mutex.Lock() - history := make([]StoreSoftDeleteExpiredUploadsViaTraversalFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSoftDeleteExpiredUploadsViaTraversalFuncCall is an object that -// describes an invocation of method SoftDeleteExpiredUploadsViaTraversal on -// an instance of MockStore. -type StoreSoftDeleteExpiredUploadsViaTraversalFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSourcedCommitsWithoutCommittedAtFunc describes the behavior when the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// is invoked. -type StoreSourcedCommitsWithoutCommittedAtFunc struct { - defaultHook func(context.Context, int) ([]store.SourcedCommits, error) - hooks []func(context.Context, int) ([]store.SourcedCommits, error) - history []StoreSourcedCommitsWithoutCommittedAtFuncCall - mutex sync.Mutex -} - -// SourcedCommitsWithoutCommittedAt delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) SourcedCommitsWithoutCommittedAt(v0 context.Context, v1 int) ([]store.SourcedCommits, error) { - r0, r1 := m.SourcedCommitsWithoutCommittedAtFunc.nextHook()(v0, v1) - m.SourcedCommitsWithoutCommittedAtFunc.appendCall(StoreSourcedCommitsWithoutCommittedAtFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) SetDefaultHook(hook func(context.Context, int) ([]store.SourcedCommits, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) PushHook(hook func(context.Context, int) ([]store.SourcedCommits, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) SetDefaultReturn(r0 []store.SourcedCommits, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]store.SourcedCommits, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) PushReturn(r0 []store.SourcedCommits, r1 error) { - f.PushHook(func(context.Context, int) ([]store.SourcedCommits, error) { - return r0, r1 - }) -} - -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) nextHook() func(context.Context, int) ([]store.SourcedCommits, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) appendCall(r0 StoreSourcedCommitsWithoutCommittedAtFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSourcedCommitsWithoutCommittedAtFuncCall objects describing the -// invocations of this function. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) History() []StoreSourcedCommitsWithoutCommittedAtFuncCall { - f.mutex.Lock() - history := make([]StoreSourcedCommitsWithoutCommittedAtFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSourcedCommitsWithoutCommittedAtFuncCall is an object that describes -// an invocation of method SourcedCommitsWithoutCommittedAt on an instance -// of MockStore. -type StoreSourcedCommitsWithoutCommittedAtFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []store.SourcedCommits - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSourcedCommitsWithoutCommittedAtFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSourcedCommitsWithoutCommittedAtFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreUpdateCommittedAtFunc describes the behavior when the -// UpdateCommittedAt method of the parent MockStore instance is invoked. -type StoreUpdateCommittedAtFunc struct { - defaultHook func(context.Context, int, string, string) error - hooks []func(context.Context, int, string, string) error - history []StoreUpdateCommittedAtFuncCall - mutex sync.Mutex -} - -// UpdateCommittedAt delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) UpdateCommittedAt(v0 context.Context, v1 int, v2 string, v3 string) error { - r0 := m.UpdateCommittedAtFunc.nextHook()(v0, v1, v2, v3) - m.UpdateCommittedAtFunc.appendCall(StoreUpdateCommittedAtFuncCall{v0, v1, v2, v3, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the UpdateCommittedAt -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreUpdateCommittedAtFunc) SetDefaultHook(hook func(context.Context, int, string, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateCommittedAt method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreUpdateCommittedAtFunc) PushHook(hook func(context.Context, int, string, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateCommittedAtFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateCommittedAtFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string, string) error { - return r0 - }) -} - -func (f *StoreUpdateCommittedAtFunc) nextHook() func(context.Context, int, string, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateCommittedAtFunc) appendCall(r0 StoreUpdateCommittedAtFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateCommittedAtFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdateCommittedAtFunc) History() []StoreUpdateCommittedAtFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateCommittedAtFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateCommittedAtFuncCall is an object that describes an invocation -// of method UpdateCommittedAt on an instance of MockStore. -type StoreUpdateCommittedAtFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateCommittedAtFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateCommittedAtFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdatePackageReferencesFunc describes the behavior when the -// UpdatePackageReferences method of the parent MockStore instance is -// invoked. -type StoreUpdatePackageReferencesFunc struct { - defaultHook func(context.Context, int, []precise.PackageReference) error - hooks []func(context.Context, int, []precise.PackageReference) error - history []StoreUpdatePackageReferencesFuncCall - mutex sync.Mutex -} - -// UpdatePackageReferences delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) UpdatePackageReferences(v0 context.Context, v1 int, v2 []precise.PackageReference) error { - r0 := m.UpdatePackageReferencesFunc.nextHook()(v0, v1, v2) - m.UpdatePackageReferencesFunc.appendCall(StoreUpdatePackageReferencesFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdatePackageReferences method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreUpdatePackageReferencesFunc) SetDefaultHook(hook func(context.Context, int, []precise.PackageReference) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdatePackageReferences method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreUpdatePackageReferencesFunc) PushHook(hook func(context.Context, int, []precise.PackageReference) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdatePackageReferencesFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, []precise.PackageReference) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdatePackageReferencesFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, []precise.PackageReference) error { - return r0 - }) -} - -func (f *StoreUpdatePackageReferencesFunc) nextHook() func(context.Context, int, []precise.PackageReference) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdatePackageReferencesFunc) appendCall(r0 StoreUpdatePackageReferencesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdatePackageReferencesFuncCall -// objects describing the invocations of this function. -func (f *StoreUpdatePackageReferencesFunc) History() []StoreUpdatePackageReferencesFuncCall { - f.mutex.Lock() - history := make([]StoreUpdatePackageReferencesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdatePackageReferencesFuncCall is an object that describes an -// invocation of method UpdatePackageReferences on an instance of MockStore. -type StoreUpdatePackageReferencesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []precise.PackageReference - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdatePackageReferencesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdatePackageReferencesFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdatePackagesFunc describes the behavior when the UpdatePackages -// method of the parent MockStore instance is invoked. -type StoreUpdatePackagesFunc struct { - defaultHook func(context.Context, int, []precise.Package) error - hooks []func(context.Context, int, []precise.Package) error - history []StoreUpdatePackagesFuncCall - mutex sync.Mutex -} - -// UpdatePackages delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) UpdatePackages(v0 context.Context, v1 int, v2 []precise.Package) error { - r0 := m.UpdatePackagesFunc.nextHook()(v0, v1, v2) - m.UpdatePackagesFunc.appendCall(StoreUpdatePackagesFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the UpdatePackages -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreUpdatePackagesFunc) SetDefaultHook(hook func(context.Context, int, []precise.Package) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdatePackages method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreUpdatePackagesFunc) PushHook(hook func(context.Context, int, []precise.Package) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdatePackagesFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, []precise.Package) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdatePackagesFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, []precise.Package) error { - return r0 - }) -} - -func (f *StoreUpdatePackagesFunc) nextHook() func(context.Context, int, []precise.Package) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdatePackagesFunc) appendCall(r0 StoreUpdatePackagesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdatePackagesFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdatePackagesFunc) History() []StoreUpdatePackagesFuncCall { - f.mutex.Lock() - history := make([]StoreUpdatePackagesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdatePackagesFuncCall is an object that describes an invocation of -// method UpdatePackages on an instance of MockStore. -type StoreUpdatePackagesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []precise.Package - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdatePackagesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdatePackagesFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdateUploadRetentionFunc describes the behavior when the -// UpdateUploadRetention method of the parent MockStore instance is invoked. -type StoreUpdateUploadRetentionFunc struct { - defaultHook func(context.Context, []int, []int) error - hooks []func(context.Context, []int, []int) error - history []StoreUpdateUploadRetentionFuncCall - mutex sync.Mutex -} - -// UpdateUploadRetention delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) UpdateUploadRetention(v0 context.Context, v1 []int, v2 []int) error { - r0 := m.UpdateUploadRetentionFunc.nextHook()(v0, v1, v2) - m.UpdateUploadRetentionFunc.appendCall(StoreUpdateUploadRetentionFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdateUploadRetention method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreUpdateUploadRetentionFunc) SetDefaultHook(hook func(context.Context, []int, []int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateUploadRetention method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreUpdateUploadRetentionFunc) PushHook(hook func(context.Context, []int, []int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateUploadRetentionFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, []int, []int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateUploadRetentionFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, []int, []int) error { - return r0 - }) -} - -func (f *StoreUpdateUploadRetentionFunc) nextHook() func(context.Context, []int, []int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateUploadRetentionFunc) appendCall(r0 StoreUpdateUploadRetentionFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateUploadRetentionFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdateUploadRetentionFunc) History() []StoreUpdateUploadRetentionFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateUploadRetentionFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateUploadRetentionFuncCall is an object that describes an -// invocation of method UpdateUploadRetention on an instance of MockStore. -type StoreUpdateUploadRetentionFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateUploadRetentionFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateUploadRetentionFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdateUploadsVisibleToCommitsFunc describes the behavior when the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance is -// invoked. -type StoreUpdateUploadsVisibleToCommitsFunc struct { - defaultHook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error - hooks []func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error - history []StoreUpdateUploadsVisibleToCommitsFuncCall - mutex sync.Mutex -} - -// UpdateUploadsVisibleToCommits delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) UpdateUploadsVisibleToCommits(v0 context.Context, v1 int, v2 *commitgraph.CommitGraph, v3 map[string][]gitdomain.Ref, v4 time.Duration, v5 time.Duration, v6 int, v7 time.Time) error { - r0 := m.UpdateUploadsVisibleToCommitsFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6, v7) - m.UpdateUploadsVisibleToCommitsFunc.appendCall(StoreUpdateUploadsVisibleToCommitsFuncCall{v0, v1, v2, v3, v4, v5, v6, v7, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) SetDefaultHook(hook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) PushHook(hook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - return r0 - }) -} - -func (f *StoreUpdateUploadsVisibleToCommitsFunc) nextHook() func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateUploadsVisibleToCommitsFunc) appendCall(r0 StoreUpdateUploadsVisibleToCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateUploadsVisibleToCommitsFuncCall -// objects describing the invocations of this function. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) History() []StoreUpdateUploadsVisibleToCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateUploadsVisibleToCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateUploadsVisibleToCommitsFuncCall is an object that describes an -// invocation of method UpdateUploadsVisibleToCommits on an instance of -// MockStore. -type StoreUpdateUploadsVisibleToCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *commitgraph.CommitGraph - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 map[string][]gitdomain.Ref - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 time.Duration - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 time.Duration - // Arg6 is the value of the 7th argument passed to this method - // invocation. - Arg6 int - // Arg7 is the value of the 8th argument passed to this method - // invocation. - Arg7 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateUploadsVisibleToCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5, c.Arg6, c.Arg7} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateUploadsVisibleToCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreWithTransactionFunc describes the behavior when the WithTransaction -// method of the parent MockStore instance is invoked. -type StoreWithTransactionFunc struct { - defaultHook func(context.Context, func(s store.Store) error) error - hooks []func(context.Context, func(s store.Store) error) error - history []StoreWithTransactionFuncCall - mutex sync.Mutex -} - -// WithTransaction delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) WithTransaction(v0 context.Context, v1 func(s store.Store) error) error { - r0 := m.WithTransactionFunc.nextHook()(v0, v1) - m.WithTransactionFunc.appendCall(StoreWithTransactionFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the WithTransaction -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreWithTransactionFunc) SetDefaultHook(hook func(context.Context, func(s store.Store) error) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// WithTransaction method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreWithTransactionFunc) PushHook(hook func(context.Context, func(s store.Store) error) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreWithTransactionFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, func(s store.Store) error) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreWithTransactionFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, func(s store.Store) error) error { - return r0 - }) -} - -func (f *StoreWithTransactionFunc) nextHook() func(context.Context, func(s store.Store) error) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreWithTransactionFunc) appendCall(r0 StoreWithTransactionFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreWithTransactionFuncCall objects -// describing the invocations of this function. -func (f *StoreWithTransactionFunc) History() []StoreWithTransactionFuncCall { - f.mutex.Lock() - history := make([]StoreWithTransactionFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreWithTransactionFuncCall is an object that describes an invocation of -// method WithTransaction on an instance of MockStore. -type StoreWithTransactionFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 func(s store.Store) error - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreWithTransactionFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreWithTransactionFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreWorkerutilStoreFunc describes the behavior when the WorkerutilStore -// method of the parent MockStore instance is invoked. -type StoreWorkerutilStoreFunc struct { - defaultHook func(*observation.Context) store1.Store[shared1.Upload] - hooks []func(*observation.Context) store1.Store[shared1.Upload] - history []StoreWorkerutilStoreFuncCall - mutex sync.Mutex -} - -// WorkerutilStore delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) WorkerutilStore(v0 *observation.Context) store1.Store[shared1.Upload] { - r0 := m.WorkerutilStoreFunc.nextHook()(v0) - m.WorkerutilStoreFunc.appendCall(StoreWorkerutilStoreFuncCall{v0, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the WorkerutilStore -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreWorkerutilStoreFunc) SetDefaultHook(hook func(*observation.Context) store1.Store[shared1.Upload]) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// WorkerutilStore method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreWorkerutilStoreFunc) PushHook(hook func(*observation.Context) store1.Store[shared1.Upload]) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreWorkerutilStoreFunc) SetDefaultReturn(r0 store1.Store[shared1.Upload]) { - f.SetDefaultHook(func(*observation.Context) store1.Store[shared1.Upload] { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreWorkerutilStoreFunc) PushReturn(r0 store1.Store[shared1.Upload]) { - f.PushHook(func(*observation.Context) store1.Store[shared1.Upload] { - return r0 - }) -} - -func (f *StoreWorkerutilStoreFunc) nextHook() func(*observation.Context) store1.Store[shared1.Upload] { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreWorkerutilStoreFunc) appendCall(r0 StoreWorkerutilStoreFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreWorkerutilStoreFuncCall objects -// describing the invocations of this function. -func (f *StoreWorkerutilStoreFunc) History() []StoreWorkerutilStoreFuncCall { - f.mutex.Lock() - history := make([]StoreWorkerutilStoreFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreWorkerutilStoreFuncCall is an object that describes an invocation of -// method WorkerutilStore on an instance of MockStore. -type StoreWorkerutilStoreFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 *observation.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 store1.Store[shared1.Upload] -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreWorkerutilStoreFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreWorkerutilStoreFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - // MockWorkerStore is a mock implementation of the Store interface (from the // package // github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store) @@ -8621,7 +408,7 @@ type MockWorkerStore[T workerutil.Record] struct { func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (r0 int, r1 error) { + defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (r0 int, r1 error) { return }, }, @@ -8636,22 +423,22 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{ - defaultHook: func(context.Context, []string, store1.HeartbeatOptions) (r0 []string, r1 []string, r2 error) { + defaultHook: func(context.Context, []string, store.HeartbeatOptions) (r0 []string, r1 []string, r2 error) { return }, }, MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{ - defaultHook: func(context.Context, int, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, @@ -8676,12 +463,12 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (r0 error) { + defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (r0 error) { return }, }, WithFunc: &WorkerStoreWithFunc[T]{ - defaultHook: func(basestore.ShareableStore) (r0 store1.Store[T]) { + defaultHook: func(basestore.ShareableStore) (r0 store.Store[T]) { return }, }, @@ -8693,7 +480,7 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { panic("unexpected invocation of MockWorkerStore.AddExecutionLogEntry") }, }, @@ -8708,22 +495,22 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{ - defaultHook: func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + defaultHook: func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { panic("unexpected invocation of MockWorkerStore.Heartbeat") }, }, MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{ - defaultHook: func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkComplete") }, }, MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkErrored") }, }, MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkFailed") }, }, @@ -8748,12 +535,12 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { panic("unexpected invocation of MockWorkerStore.UpdateExecutionLogEntry") }, }, WithFunc: &WorkerStoreWithFunc[T]{ - defaultHook: func(basestore.ShareableStore) store1.Store[T] { + defaultHook: func(basestore.ShareableStore) store.Store[T] { panic("unexpected invocation of MockWorkerStore.With") }, }, @@ -8763,7 +550,7 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { // NewMockWorkerStoreFrom creates a new mock of the MockWorkerStore // interface. All methods delegate to the given implementation, unless // overwritten. -func NewMockWorkerStoreFrom[T workerutil.Record](i store1.Store[T]) *MockWorkerStore[T] { +func NewMockWorkerStoreFrom[T workerutil.Record](i store.Store[T]) *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ defaultHook: i.AddExecutionLogEntry, @@ -8811,15 +598,15 @@ func NewMockWorkerStoreFrom[T workerutil.Record](i store1.Store[T]) *MockWorkerS // AddExecutionLogEntry method of the parent MockWorkerStore instance is // invoked. type WorkerStoreAddExecutionLogEntryFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) - hooks []func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) + defaultHook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) + hooks []func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) history []WorkerStoreAddExecutionLogEntryFuncCall[T] mutex sync.Mutex } // AddExecutionLogEntry delegates to the next hook function in the queue and // stores the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 executor.ExecutionLogEntry, v3 store1.ExecutionLogEntryOptions) (int, error) { +func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 executor.ExecutionLogEntry, v3 store.ExecutionLogEntryOptions) (int, error) { r0, r1 := m.AddExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3) m.AddExecutionLogEntryFunc.appendCall(WorkerStoreAddExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -8828,7 +615,7 @@ func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 // SetDefaultHook sets function that is called when the AddExecutionLogEntry // method of the parent MockWorkerStore instance is invoked and the hook // queue is empty. -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error)) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error)) { f.defaultHook = hook } @@ -8837,7 +624,7 @@ func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(contex // invokes the hook at the front of the queue and discards it. After the // queue is empty, the default hook function is invoked for any future // action. -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error)) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -8846,19 +633,19 @@ func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Cont // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + f.SetDefaultHook(func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + f.PushHook(func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { return r0, r1 }) } -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -8903,7 +690,7 @@ type WorkerStoreAddExecutionLogEntryFuncCall[T workerutil.Record] struct { Arg2 executor.ExecutionLogEntry // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.ExecutionLogEntryOptions + Arg3 store.ExecutionLogEntryOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 int @@ -9139,15 +926,15 @@ func (c WorkerStoreHandleFuncCall[T]) Results() []interface{} { // WorkerStoreHeartbeatFunc describes the behavior when the Heartbeat method // of the parent MockWorkerStore instance is invoked. type WorkerStoreHeartbeatFunc[T workerutil.Record] struct { - defaultHook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) - hooks []func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) + defaultHook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) + hooks []func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) history []WorkerStoreHeartbeatFuncCall[T] mutex sync.Mutex } // Heartbeat delegates to the next hook function in the queue and stores the // parameter and result values of this invocation. -func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store1.HeartbeatOptions) ([]string, []string, error) { +func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store.HeartbeatOptions) ([]string, []string, error) { r0, r1, r2 := m.HeartbeatFunc.nextHook()(v0, v1, v2) m.HeartbeatFunc.appendCall(WorkerStoreHeartbeatFuncCall[T]{v0, v1, v2, r0, r1, r2}) return r0, r1, r2 @@ -9156,7 +943,7 @@ func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store // SetDefaultHook sets function that is called when the Heartbeat method of // the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error)) { +func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error)) { f.defaultHook = hook } @@ -9164,7 +951,7 @@ func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, // Heartbeat method of the parent MockWorkerStore instance invokes the hook // at the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error)) { +func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9173,19 +960,19 @@ func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []stri // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultReturn(r0 []string, r1 []string, r2 error) { - f.SetDefaultHook(func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + f.SetDefaultHook(func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { return r0, r1, r2 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreHeartbeatFunc[T]) PushReturn(r0 []string, r1 []string, r2 error) { - f.PushHook(func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + f.PushHook(func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { return r0, r1, r2 }) } -func (f *WorkerStoreHeartbeatFunc[T]) nextHook() func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { +func (f *WorkerStoreHeartbeatFunc[T]) nextHook() func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9226,7 +1013,7 @@ type WorkerStoreHeartbeatFuncCall[T workerutil.Record] struct { Arg1 []string // Arg2 is the value of the 3rd argument passed to this method // invocation. - Arg2 store1.HeartbeatOptions + Arg2 store.HeartbeatOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 []string @@ -9253,15 +1040,15 @@ func (c WorkerStoreHeartbeatFuncCall[T]) Results() []interface{} { // WorkerStoreMarkCompleteFunc describes the behavior when the MarkComplete // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkCompleteFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkCompleteFuncCall[T] mutex sync.Mutex } // MarkComplete delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkCompleteFunc.nextHook()(v0, v1, v2) m.MarkCompleteFunc.appendCall(WorkerStoreMarkCompleteFuncCall[T]{v0, v1, v2, r0, r1}) return r0, r1 @@ -9270,7 +1057,7 @@ func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store1. // SetDefaultHook sets function that is called when the MarkComplete method // of the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Context, int, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Context, int, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9278,7 +1065,7 @@ func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Contex // MarkComplete method of the parent MockWorkerStore instance invokes the // hook at the front of the queue and discards it. After the queue is empty, // the default hook function is invoked for any future action. -func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9287,19 +1074,19 @@ func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkCompleteFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkCompleteFunc[T]) nextHook() func(context.Context, int, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkCompleteFunc[T]) nextHook() func(context.Context, int, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9340,7 +1127,7 @@ type WorkerStoreMarkCompleteFuncCall[T workerutil.Record] struct { Arg1 int // Arg2 is the value of the 3rd argument passed to this method // invocation. - Arg2 store1.MarkFinalOptions + Arg2 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -9364,15 +1151,15 @@ func (c WorkerStoreMarkCompleteFuncCall[T]) Results() []interface{} { // WorkerStoreMarkErroredFunc describes the behavior when the MarkErrored // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkErroredFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, string, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, string, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkErroredFuncCall[T] mutex sync.Mutex } // MarkErrored delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, v3 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, v3 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkErroredFunc.nextHook()(v0, v1, v2, v3) m.MarkErroredFunc.appendCall(WorkerStoreMarkErroredFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -9381,7 +1168,7 @@ func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, // SetDefaultHook sets function that is called when the MarkErrored method // of the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9389,7 +1176,7 @@ func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context // MarkErrored method of the parent MockWorkerStore instance invokes the // hook at the front of the queue and discards it. After the queue is empty, // the default hook function is invoked for any future action. -func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9398,19 +1185,19 @@ func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkErroredFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkErroredFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkErroredFunc[T]) nextHook() func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9454,7 +1241,7 @@ type WorkerStoreMarkErroredFuncCall[T workerutil.Record] struct { Arg2 string // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.MarkFinalOptions + Arg3 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -9478,15 +1265,15 @@ func (c WorkerStoreMarkErroredFuncCall[T]) Results() []interface{} { // WorkerStoreMarkFailedFunc describes the behavior when the MarkFailed // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkFailedFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, string, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, string, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkFailedFuncCall[T] mutex sync.Mutex } // MarkFailed delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v3 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v3 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkFailedFunc.nextHook()(v0, v1, v2, v3) m.MarkFailedFunc.appendCall(WorkerStoreMarkFailedFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -9495,7 +1282,7 @@ func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v // SetDefaultHook sets function that is called when the MarkFailed method of // the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9503,7 +1290,7 @@ func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, // MarkFailed method of the parent MockWorkerStore instance invokes the hook // at the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9512,19 +1299,19 @@ func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkFailedFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkFailedFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkFailedFunc[T]) nextHook() func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9568,7 +1355,7 @@ type WorkerStoreMarkFailedFuncCall[T workerutil.Record] struct { Arg2 string // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.MarkFinalOptions + Arg3 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -10024,15 +1811,15 @@ func (c WorkerStoreResetStalledFuncCall[T]) Results() []interface{} { // UpdateExecutionLogEntry method of the parent MockWorkerStore instance is // invoked. type WorkerStoreUpdateExecutionLogEntryFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error - hooks []func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error + defaultHook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error + hooks []func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error history []WorkerStoreUpdateExecutionLogEntryFuncCall[T] mutex sync.Mutex } // UpdateExecutionLogEntry delegates to the next hook function in the queue // and stores the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, v2 int, v3 executor.ExecutionLogEntry, v4 store1.ExecutionLogEntryOptions) error { +func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, v2 int, v3 executor.ExecutionLogEntry, v4 store.ExecutionLogEntryOptions) error { r0 := m.UpdateExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3, v4) m.UpdateExecutionLogEntryFunc.appendCall(WorkerStoreUpdateExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, v4, r0}) return r0 @@ -10041,7 +1828,7 @@ func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, // SetDefaultHook sets function that is called when the // UpdateExecutionLogEntry method of the parent MockWorkerStore instance is // invoked and the hook queue is empty. -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error) { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error) { f.defaultHook = hook } @@ -10050,7 +1837,7 @@ func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(con // invokes the hook at the front of the queue and discards it. After the // queue is empty, the default hook function is invoked for any future // action. -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error) { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -10059,19 +1846,19 @@ func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.C // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + f.SetDefaultHook(func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { return r0 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + f.PushHook(func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { return r0 }) } -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { f.mutex.Lock() defer f.mutex.Unlock() @@ -10119,7 +1906,7 @@ type WorkerStoreUpdateExecutionLogEntryFuncCall[T workerutil.Record] struct { Arg3 executor.ExecutionLogEntry // Arg4 is the value of the 5th argument passed to this method // invocation. - Arg4 store1.ExecutionLogEntryOptions + Arg4 store.ExecutionLogEntryOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 error @@ -10140,15 +1927,15 @@ func (c WorkerStoreUpdateExecutionLogEntryFuncCall[T]) Results() []interface{} { // WorkerStoreWithFunc describes the behavior when the With method of the // parent MockWorkerStore instance is invoked. type WorkerStoreWithFunc[T workerutil.Record] struct { - defaultHook func(basestore.ShareableStore) store1.Store[T] - hooks []func(basestore.ShareableStore) store1.Store[T] + defaultHook func(basestore.ShareableStore) store.Store[T] + hooks []func(basestore.ShareableStore) store.Store[T] history []WorkerStoreWithFuncCall[T] mutex sync.Mutex } // With delegates to the next hook function in the queue and stores the // parameter and result values of this invocation. -func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store1.Store[T] { +func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store.Store[T] { r0 := m.WithFunc.nextHook()(v0) m.WithFunc.appendCall(WorkerStoreWithFuncCall[T]{v0, r0}) return r0 @@ -10156,7 +1943,7 @@ func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store1.Store[T] { // SetDefaultHook sets function that is called when the With method of the // parent MockWorkerStore instance is invoked and the hook queue is empty. -func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableStore) store1.Store[T]) { +func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableStore) store.Store[T]) { f.defaultHook = hook } @@ -10164,7 +1951,7 @@ func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableSto // With method of the parent MockWorkerStore instance invokes the hook at // the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) store1.Store[T]) { +func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) store.Store[T]) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -10172,20 +1959,20 @@ func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) st // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. -func (f *WorkerStoreWithFunc[T]) SetDefaultReturn(r0 store1.Store[T]) { - f.SetDefaultHook(func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) SetDefaultReturn(r0 store.Store[T]) { + f.SetDefaultHook(func(basestore.ShareableStore) store.Store[T] { return r0 }) } // PushReturn calls PushHook with a function that returns the given values. -func (f *WorkerStoreWithFunc[T]) PushReturn(r0 store1.Store[T]) { - f.PushHook(func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) PushReturn(r0 store.Store[T]) { + f.PushHook(func(basestore.ShareableStore) store.Store[T] { return r0 }) } -func (f *WorkerStoreWithFunc[T]) nextHook() func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) nextHook() func(basestore.ShareableStore) store.Store[T] { f.mutex.Lock() defer f.mutex.Unlock() @@ -10223,7 +2010,7 @@ type WorkerStoreWithFuncCall[T workerutil.Record] struct { Arg0 basestore.ShareableStore // Result0 is the value of the 1st result returned from this method // invocation. - Result0 store1.Store[T] + Result0 store.Store[T] } // Args returns an interface slice containing the arguments of this diff --git a/internal/codeintel/uploads/internal/background/processor/BUILD.bazel b/internal/codeintel/uploads/internal/background/processor/BUILD.bazel index 7e20a01deef..9b2523b1ef9 100644 --- a/internal/codeintel/uploads/internal/background/processor/BUILD.bazel +++ b/internal/codeintel/uploads/internal/background/processor/BUILD.bazel @@ -60,9 +60,8 @@ go_test( "//internal/api", "//internal/codeintel/codegraph", "//internal/codeintel/codegraph/codegraphmocks", - "//internal/codeintel/core", - "//internal/codeintel/uploads/internal/commitgraph", "//internal/codeintel/uploads/internal/store", + "//internal/codeintel/uploads/internal/storemocks", "//internal/codeintel/uploads/shared", "//internal/database/basestore", "//internal/database/dbmocks", @@ -97,7 +96,6 @@ go_mockgen( ], deps = [ ":processor", - "//internal/codeintel/uploads/internal/store", "//internal/workerutil/dbworker/store", ], ) diff --git a/internal/codeintel/uploads/internal/background/processor/job_worker_handler_test.go b/internal/codeintel/uploads/internal/background/processor/job_worker_handler_test.go index caa0a8a7526..300a8a60a0f 100644 --- a/internal/codeintel/uploads/internal/background/processor/job_worker_handler_test.go +++ b/internal/codeintel/uploads/internal/background/processor/job_worker_handler_test.go @@ -23,6 +23,7 @@ import ( "github.com/sourcegraph/sourcegraph/internal/codeintel/codegraph" "github.com/sourcegraph/sourcegraph/internal/codeintel/codegraph/codegraphmocks" "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store" + "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/storemocks" "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared" "github.com/sourcegraph/sourcegraph/internal/database/dbmocks" "github.com/sourcegraph/sourcegraph/internal/fileutil" @@ -49,7 +50,7 @@ func TestHandle(t *testing.T) { } mockWorkerStore := NewMockWorkerStore[shared.Upload]() - mockDBStore := NewMockStore() + mockDBStore := storemocks.NewMockStore() mockRepoStore := defaultMockRepoStore() mockLSIFStore := codegraphmocks.NewMockDataStore() mockUploadStore := objectmocks.NewMockStorage() @@ -298,7 +299,7 @@ func TestHandleError(t *testing.T) { } mockWorkerStore := NewMockWorkerStore[shared.Upload]() - mockDBStore := NewMockStore() + mockDBStore := storemocks.NewMockStore() mockRepoStore := defaultMockRepoStore() mockLSIFStore := codegraphmocks.NewMockDataStore() mockUploadStore := objectmocks.NewMockStorage() @@ -364,7 +365,7 @@ func TestHandleCloneInProgress(t *testing.T) { } mockWorkerStore := NewMockWorkerStore[shared.Upload]() - mockDBStore := NewMockStore() + mockDBStore := storemocks.NewMockStore() mockRepoStore := defaultMockRepoStore() mockUploadStore := objectmocks.NewMockStorage() gitserverClient := gitserver.NewMockClient() diff --git a/internal/codeintel/uploads/internal/background/processor/mocks_test.go b/internal/codeintel/uploads/internal/background/processor/mocks_test.go index 3d70a8c6b83..ed9e3dcf5b7 100644 --- a/internal/codeintel/uploads/internal/background/processor/mocks_test.go +++ b/internal/codeintel/uploads/internal/background/processor/mocks_test.go @@ -13,18 +13,11 @@ import ( sqlf "github.com/keegancsmith/sqlf" api "github.com/sourcegraph/sourcegraph/internal/api" - core "github.com/sourcegraph/sourcegraph/internal/codeintel/core" - commitgraph "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/commitgraph" - store "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store" - shared "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared" basestore "github.com/sourcegraph/sourcegraph/internal/database/basestore" executor "github.com/sourcegraph/sourcegraph/internal/executor" - gitdomain "github.com/sourcegraph/sourcegraph/internal/gitserver/gitdomain" - observation "github.com/sourcegraph/sourcegraph/internal/observation" types "github.com/sourcegraph/sourcegraph/internal/types" workerutil "github.com/sourcegraph/sourcegraph/internal/workerutil" - store1 "github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store" - precise "github.com/sourcegraph/sourcegraph/lib/codeintel/precise" + store "github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store" ) // MockRepoStore is a mock implementation of the RepoStore interface (from @@ -178,8212 +171,6 @@ func (c RepoStoreGetFuncCall) Results() []interface{} { return []interface{}{c.Result0, c.Result1} } -// MockStore is a mock implementation of the Store interface (from the -// package -// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store) -// used for unit testing. -type MockStore struct { - // AddUploadPartFunc is an instance of a mock function object - // controlling the behavior of the method AddUploadPart. - AddUploadPartFunc *StoreAddUploadPartFunc - // DeleteAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method DeleteAutoIndexJobByID. - DeleteAutoIndexJobByIDFunc *StoreDeleteAutoIndexJobByIDFunc - // DeleteAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteAutoIndexJobs. - DeleteAutoIndexJobsFunc *StoreDeleteAutoIndexJobsFunc - // DeleteAutoIndexJobsWithoutRepositoryFunc is an instance of a mock - // function object controlling the behavior of the method - // DeleteAutoIndexJobsWithoutRepository. - DeleteAutoIndexJobsWithoutRepositoryFunc *StoreDeleteAutoIndexJobsWithoutRepositoryFunc - // DeleteOldAuditLogsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteOldAuditLogs. - DeleteOldAuditLogsFunc *StoreDeleteOldAuditLogsFunc - // DeleteOverlappingCompletedUploadsFunc is an instance of a mock - // function object controlling the behavior of the method - // DeleteOverlappingCompletedUploads. - DeleteOverlappingCompletedUploadsFunc *StoreDeleteOverlappingCompletedUploadsFunc - // DeleteUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method DeleteUploadByID. - DeleteUploadByIDFunc *StoreDeleteUploadByIDFunc - // DeleteUploadsFunc is an instance of a mock function object - // controlling the behavior of the method DeleteUploads. - DeleteUploadsFunc *StoreDeleteUploadsFunc - // DeleteUploadsStuckUploadingFunc is an instance of a mock function - // object controlling the behavior of the method - // DeleteUploadsStuckUploading. - DeleteUploadsStuckUploadingFunc *StoreDeleteUploadsStuckUploadingFunc - // DeleteUploadsWithoutRepositoryFunc is an instance of a mock function - // object controlling the behavior of the method - // DeleteUploadsWithoutRepository. - DeleteUploadsWithoutRepositoryFunc *StoreDeleteUploadsWithoutRepositoryFunc - // ExpireFailedRecordsFunc is an instance of a mock function object - // controlling the behavior of the method ExpireFailedRecords. - ExpireFailedRecordsFunc *StoreExpireFailedRecordsFunc - // FindClosestCompletedUploadsFunc is an instance of a mock function - // object controlling the behavior of the method - // FindClosestCompletedUploads. - FindClosestCompletedUploadsFunc *StoreFindClosestCompletedUploadsFunc - // FindClosestCompletedUploadsFromGraphFragmentFunc is an instance of a - // mock function object controlling the behavior of the method - // FindClosestCompletedUploadsFromGraphFragment. - FindClosestCompletedUploadsFromGraphFragmentFunc *StoreFindClosestCompletedUploadsFromGraphFragmentFunc - // GetAuditLogsForUploadFunc is an instance of a mock function object - // controlling the behavior of the method GetAuditLogsForUpload. - GetAuditLogsForUploadFunc *StoreGetAuditLogsForUploadFunc - // GetAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobByID. - GetAutoIndexJobByIDFunc *StoreGetAutoIndexJobByIDFunc - // GetAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobs. - GetAutoIndexJobsFunc *StoreGetAutoIndexJobsFunc - // GetAutoIndexJobsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetAutoIndexJobsByIDs. - GetAutoIndexJobsByIDsFunc *StoreGetAutoIndexJobsByIDsFunc - // GetCommitAndDateForOldestUploadFunc is an instance of a mock function - // object controlling the behavior of the method - // GetCommitAndDateForOldestUpload. - GetCommitAndDateForOldestUploadFunc *StoreGetCommitAndDateForOldestUploadFunc - // GetCommitGraphMetadataFunc is an instance of a mock function object - // controlling the behavior of the method GetCommitGraphMetadata. - GetCommitGraphMetadataFunc *StoreGetCommitGraphMetadataFunc - // GetCommitsVisibleToUploadFunc is an instance of a mock function - // object controlling the behavior of the method - // GetCommitsVisibleToUpload. - GetCommitsVisibleToUploadFunc *StoreGetCommitsVisibleToUploadFunc - // GetCompletedUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetCompletedUploadsByIDs. - GetCompletedUploadsByIDsFunc *StoreGetCompletedUploadsByIDsFunc - // GetCompletedUploadsWithDefinitionsForMonikersFunc is an instance of a - // mock function object controlling the behavior of the method - // GetCompletedUploadsWithDefinitionsForMonikers. - GetCompletedUploadsWithDefinitionsForMonikersFunc *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc - // GetDirtyRepositoriesFunc is an instance of a mock function object - // controlling the behavior of the method GetDirtyRepositories. - GetDirtyRepositoriesFunc *StoreGetDirtyRepositoriesFunc - // GetIndexersFunc is an instance of a mock function object controlling - // the behavior of the method GetIndexers. - GetIndexersFunc *StoreGetIndexersFunc - // GetLastUploadRetentionScanForRepositoryFunc is an instance of a mock - // function object controlling the behavior of the method - // GetLastUploadRetentionScanForRepository. - GetLastUploadRetentionScanForRepositoryFunc *StoreGetLastUploadRetentionScanForRepositoryFunc - // GetRecentAutoIndexJobsSummaryFunc is an instance of a mock function - // object controlling the behavior of the method - // GetRecentAutoIndexJobsSummary. - GetRecentAutoIndexJobsSummaryFunc *StoreGetRecentAutoIndexJobsSummaryFunc - // GetRecentUploadsSummaryFunc is an instance of a mock function object - // controlling the behavior of the method GetRecentUploadsSummary. - GetRecentUploadsSummaryFunc *StoreGetRecentUploadsSummaryFunc - // GetRepositoriesMaxStaleAgeFunc is an instance of a mock function - // object controlling the behavior of the method - // GetRepositoriesMaxStaleAge. - GetRepositoriesMaxStaleAgeFunc *StoreGetRepositoriesMaxStaleAgeFunc - // GetUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method GetUploadByID. - GetUploadByIDFunc *StoreGetUploadByIDFunc - // GetUploadIDsWithReferencesFunc is an instance of a mock function - // object controlling the behavior of the method - // GetUploadIDsWithReferences. - GetUploadIDsWithReferencesFunc *StoreGetUploadIDsWithReferencesFunc - // GetUploadsFunc is an instance of a mock function object controlling - // the behavior of the method GetUploads. - GetUploadsFunc *StoreGetUploadsFunc - // GetUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method GetUploadsByIDs. - GetUploadsByIDsFunc *StoreGetUploadsByIDsFunc - // GetUploadsByIDsAllowDeletedFunc is an instance of a mock function - // object controlling the behavior of the method - // GetUploadsByIDsAllowDeleted. - GetUploadsByIDsAllowDeletedFunc *StoreGetUploadsByIDsAllowDeletedFunc - // GetVisibleUploadsMatchingMonikersFunc is an instance of a mock - // function object controlling the behavior of the method - // GetVisibleUploadsMatchingMonikers. - GetVisibleUploadsMatchingMonikersFunc *StoreGetVisibleUploadsMatchingMonikersFunc - // HandleFunc is an instance of a mock function object controlling the - // behavior of the method Handle. - HandleFunc *StoreHandleFunc - // HardDeleteUploadsByIDsFunc is an instance of a mock function object - // controlling the behavior of the method HardDeleteUploadsByIDs. - HardDeleteUploadsByIDsFunc *StoreHardDeleteUploadsByIDsFunc - // HasCommitFunc is an instance of a mock function object controlling - // the behavior of the method HasCommit. - HasCommitFunc *StoreHasCommitFunc - // HasRepositoryFunc is an instance of a mock function object - // controlling the behavior of the method HasRepository. - HasRepositoryFunc *StoreHasRepositoryFunc - // InsertDependencySyncingJobFunc is an instance of a mock function - // object controlling the behavior of the method - // InsertDependencySyncingJob. - InsertDependencySyncingJobFunc *StoreInsertDependencySyncingJobFunc - // InsertUploadFunc is an instance of a mock function object controlling - // the behavior of the method InsertUpload. - InsertUploadFunc *StoreInsertUploadFunc - // MarkFailedFunc is an instance of a mock function object controlling - // the behavior of the method MarkFailed. - MarkFailedFunc *StoreMarkFailedFunc - // MarkQueuedFunc is an instance of a mock function object controlling - // the behavior of the method MarkQueued. - MarkQueuedFunc *StoreMarkQueuedFunc - // NumRepositoriesWithCodeIntelligenceFunc is an instance of a mock - // function object controlling the behavior of the method - // NumRepositoriesWithCodeIntelligence. - NumRepositoriesWithCodeIntelligenceFunc *StoreNumRepositoriesWithCodeIntelligenceFunc - // ProcessSourcedCommitsFunc is an instance of a mock function object - // controlling the behavior of the method ProcessSourcedCommits. - ProcessSourcedCommitsFunc *StoreProcessSourcedCommitsFunc - // ProcessStaleSourcedCommitsFunc is an instance of a mock function - // object controlling the behavior of the method - // ProcessStaleSourcedCommits. - ProcessStaleSourcedCommitsFunc *StoreProcessStaleSourcedCommitsFunc - // ReconcileCandidatesFunc is an instance of a mock function object - // controlling the behavior of the method ReconcileCandidates. - ReconcileCandidatesFunc *StoreReconcileCandidatesFunc - // ReferencesForUploadFunc is an instance of a mock function object - // controlling the behavior of the method ReferencesForUpload. - ReferencesForUploadFunc *StoreReferencesForUploadFunc - // ReindexUploadByIDFunc is an instance of a mock function object - // controlling the behavior of the method ReindexUploadByID. - ReindexUploadByIDFunc *StoreReindexUploadByIDFunc - // ReindexUploadsFunc is an instance of a mock function object - // controlling the behavior of the method ReindexUploads. - ReindexUploadsFunc *StoreReindexUploadsFunc - // RepositoryIDsWithErrorsFunc is an instance of a mock function object - // controlling the behavior of the method RepositoryIDsWithErrors. - RepositoryIDsWithErrorsFunc *StoreRepositoryIDsWithErrorsFunc - // SetRepositoriesForRetentionScanFunc is an instance of a mock function - // object controlling the behavior of the method - // SetRepositoriesForRetentionScan. - SetRepositoriesForRetentionScanFunc *StoreSetRepositoriesForRetentionScanFunc - // SetRepositoryAsDirtyFunc is an instance of a mock function object - // controlling the behavior of the method SetRepositoryAsDirty. - SetRepositoryAsDirtyFunc *StoreSetRepositoryAsDirtyFunc - // SetRerunAutoIndexJobByIDFunc is an instance of a mock function object - // controlling the behavior of the method SetRerunAutoIndexJobByID. - SetRerunAutoIndexJobByIDFunc *StoreSetRerunAutoIndexJobByIDFunc - // SetRerunAutoIndexJobsFunc is an instance of a mock function object - // controlling the behavior of the method SetRerunAutoIndexJobs. - SetRerunAutoIndexJobsFunc *StoreSetRerunAutoIndexJobsFunc - // SoftDeleteExpiredUploadsFunc is an instance of a mock function object - // controlling the behavior of the method SoftDeleteExpiredUploads. - SoftDeleteExpiredUploadsFunc *StoreSoftDeleteExpiredUploadsFunc - // SoftDeleteExpiredUploadsViaTraversalFunc is an instance of a mock - // function object controlling the behavior of the method - // SoftDeleteExpiredUploadsViaTraversal. - SoftDeleteExpiredUploadsViaTraversalFunc *StoreSoftDeleteExpiredUploadsViaTraversalFunc - // SourcedCommitsWithoutCommittedAtFunc is an instance of a mock - // function object controlling the behavior of the method - // SourcedCommitsWithoutCommittedAt. - SourcedCommitsWithoutCommittedAtFunc *StoreSourcedCommitsWithoutCommittedAtFunc - // UpdateCommittedAtFunc is an instance of a mock function object - // controlling the behavior of the method UpdateCommittedAt. - UpdateCommittedAtFunc *StoreUpdateCommittedAtFunc - // UpdatePackageReferencesFunc is an instance of a mock function object - // controlling the behavior of the method UpdatePackageReferences. - UpdatePackageReferencesFunc *StoreUpdatePackageReferencesFunc - // UpdatePackagesFunc is an instance of a mock function object - // controlling the behavior of the method UpdatePackages. - UpdatePackagesFunc *StoreUpdatePackagesFunc - // UpdateUploadRetentionFunc is an instance of a mock function object - // controlling the behavior of the method UpdateUploadRetention. - UpdateUploadRetentionFunc *StoreUpdateUploadRetentionFunc - // UpdateUploadsVisibleToCommitsFunc is an instance of a mock function - // object controlling the behavior of the method - // UpdateUploadsVisibleToCommits. - UpdateUploadsVisibleToCommitsFunc *StoreUpdateUploadsVisibleToCommitsFunc - // WithTransactionFunc is an instance of a mock function object - // controlling the behavior of the method WithTransaction. - WithTransactionFunc *StoreWithTransactionFunc - // WorkerutilStoreFunc is an instance of a mock function object - // controlling the behavior of the method WorkerutilStore. - WorkerutilStoreFunc *StoreWorkerutilStoreFunc -} - -// NewMockStore creates a new mock of the Store interface. All methods -// return zero values for all results, unless overwritten. -func NewMockStore() *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: func(context.Context, int, int) (r0 error) { - return - }, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 error) { - return - }, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.DeleteAutoIndexJobsOptions) (r0 error) { - return - }, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: func(context.Context, time.Duration, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: func(context.Context, int, string, string, string) (r0 error) { - return - }, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 error) { - return - }, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: func(context.Context, shared.DeleteUploadsOptions) (r0 error) { - return - }, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: func(context.Context, int, time.Duration, time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: func(context.Context, shared.UploadMatchingOptions) (r0 []shared.CompletedUpload, r1 error) { - return - }, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) (r0 []shared.CompletedUpload, r1 error) { - return - }, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: func(context.Context, int) (r0 []shared.UploadLog, r1 error) { - return - }, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 shared.AutoIndexJob, r1 bool, r2 error) { - return - }, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.GetAutoIndexJobsOptions) (r0 []shared.AutoIndexJob, r1 int, r2 error) { - return - }, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared.AutoIndexJob, r1 error) { - return - }, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: func(context.Context, int) (r0 core.Option[store.CommitWithDate], r1 error) { - return - }, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: func(context.Context, int) (r0 bool, r1 *time.Time, r2 error) { - return - }, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: func(context.Context, int, int, *string) (r0 []string, r1 *string, r2 error) { - return - }, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: func(context.Context, []int) (r0 []shared.CompletedUpload, r1 error) { - return - }, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData) (r0 []shared.CompletedUpload, r1 error) { - return - }, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: func(context.Context) (r0 []shared.DirtyRepository, r1 error) { - return - }, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: func(context.Context, shared.GetIndexersOptions) (r0 []string, r1 error) { - return - }, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: func(context.Context, int) (r0 *time.Time, r1 error) { - return - }, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: func(context.Context, int) (r0 []shared.GroupedAutoIndexJobs, r1 error) { - return - }, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: func(context.Context, int) (r0 []shared.UploadsWithRepositoryNamespace, r1 error) { - return - }, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: func(context.Context) (r0 time.Duration, r1 error) { - return - }, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 shared.Upload, r1 bool, r2 error) { - return - }, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) (r0 []int, r1 int, r2 int, r3 error) { - return - }, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: func(context.Context, shared.GetUploadsOptions) (r0 []shared.Upload, r1 int, r2 error) { - return - }, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared.Upload, r1 error) { - return - }, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: func(context.Context, ...int) (r0 []shared.Upload, r1 error) { - return - }, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (r0 shared.PackageReferenceScanner, r1 int, r2 error) { - return - }, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: func() (r0 *basestore.Store) { - return - }, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) (r0 error) { - return - }, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: func(context.Context, api.RepoID, api.CommitID) (r0 bool, r1 error) { - return - }, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: func(context.Context, api.RepoID) (r0 bool, r1 error) { - return - }, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 error) { - return - }, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: func(context.Context, shared.Upload) (r0 int, r1 error) { - return - }, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: func(context.Context, int, string) (r0 error) { - return - }, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: func(context.Context, int, *int64) (r0 error) { - return - }, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: func(context.Context) (r0 int, r1 error) { - return - }, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (r0 int, r1 int, r2 error) { - return - }, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (r0 int, r1 int, r2 error) { - return - }, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: func(context.Context, int) (r0 []int, r1 error) { - return - }, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: func(context.Context, int) (r0 shared.PackageReferenceScanner, r1 error) { - return - }, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: func(context.Context, shared.ReindexUploadsOptions) (r0 error) { - return - }, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: func(context.Context, int, int) (r0 []shared.RepositoryWithCount, r1 int, r2 error) { - return - }, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: func(context.Context, time.Duration, int) (r0 []int, r1 error) { - return - }, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (r0 error) { - return - }, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.SetRerunAutoIndexJobsOptions) (r0 error) { - return - }, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 int, r2 error) { - return - }, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: func(context.Context, int) (r0 int, r1 int, r2 error) { - return - }, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: func(context.Context, int) (r0 []store.SourcedCommits, r1 error) { - return - }, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: func(context.Context, int, string, string) (r0 error) { - return - }, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: func(context.Context, int, []precise.PackageReference) (r0 error) { - return - }, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: func(context.Context, int, []precise.Package) (r0 error) { - return - }, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: func(context.Context, []int, []int) (r0 error) { - return - }, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) (r0 error) { - return - }, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: func(context.Context, func(s store.Store) error) (r0 error) { - return - }, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: func(*observation.Context) (r0 store1.Store[shared.Upload]) { - return - }, - }, - } -} - -// NewStrictMockStore creates a new mock of the Store interface. All methods -// panic on invocation, unless overwritten. -func NewStrictMockStore() *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: func(context.Context, int, int) error { - panic("unexpected invocation of MockStore.AddUploadPart") - }, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (bool, error) { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobByID") - }, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.DeleteAutoIndexJobsOptions) error { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobs") - }, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteAutoIndexJobsWithoutRepository") - }, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: func(context.Context, time.Duration, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteOldAuditLogs") - }, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: func(context.Context, int, string, string, string) error { - panic("unexpected invocation of MockStore.DeleteOverlappingCompletedUploads") - }, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: func(context.Context, int) (bool, error) { - panic("unexpected invocation of MockStore.DeleteUploadByID") - }, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: func(context.Context, shared.DeleteUploadsOptions) error { - panic("unexpected invocation of MockStore.DeleteUploads") - }, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteUploadsStuckUploading") - }, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: func(context.Context, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.DeleteUploadsWithoutRepository") - }, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: func(context.Context, int, time.Duration, time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.ExpireFailedRecords") - }, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) { - panic("unexpected invocation of MockStore.FindClosestCompletedUploads") - }, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) { - panic("unexpected invocation of MockStore.FindClosestCompletedUploadsFromGraphFragment") - }, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: func(context.Context, int) ([]shared.UploadLog, error) { - panic("unexpected invocation of MockStore.GetAuditLogsForUpload") - }, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) (shared.AutoIndexJob, bool, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobByID") - }, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobs") - }, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: func(context.Context, ...int) ([]shared.AutoIndexJob, error) { - panic("unexpected invocation of MockStore.GetAutoIndexJobsByIDs") - }, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: func(context.Context, int) (core.Option[store.CommitWithDate], error) { - panic("unexpected invocation of MockStore.GetCommitAndDateForOldestUpload") - }, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: func(context.Context, int) (bool, *time.Time, error) { - panic("unexpected invocation of MockStore.GetCommitGraphMetadata") - }, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: func(context.Context, int, int, *string) ([]string, *string, error) { - panic("unexpected invocation of MockStore.GetCommitsVisibleToUpload") - }, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: func(context.Context, []int) ([]shared.CompletedUpload, error) { - panic("unexpected invocation of MockStore.GetCompletedUploadsByIDs") - }, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) { - panic("unexpected invocation of MockStore.GetCompletedUploadsWithDefinitionsForMonikers") - }, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: func(context.Context) ([]shared.DirtyRepository, error) { - panic("unexpected invocation of MockStore.GetDirtyRepositories") - }, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: func(context.Context, shared.GetIndexersOptions) ([]string, error) { - panic("unexpected invocation of MockStore.GetIndexers") - }, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: func(context.Context, int) (*time.Time, error) { - panic("unexpected invocation of MockStore.GetLastUploadRetentionScanForRepository") - }, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) { - panic("unexpected invocation of MockStore.GetRecentAutoIndexJobsSummary") - }, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) { - panic("unexpected invocation of MockStore.GetRecentUploadsSummary") - }, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: func(context.Context) (time.Duration, error) { - panic("unexpected invocation of MockStore.GetRepositoriesMaxStaleAge") - }, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: func(context.Context, int) (shared.Upload, bool, error) { - panic("unexpected invocation of MockStore.GetUploadByID") - }, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - panic("unexpected invocation of MockStore.GetUploadIDsWithReferences") - }, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) { - panic("unexpected invocation of MockStore.GetUploads") - }, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) ([]shared.Upload, error) { - panic("unexpected invocation of MockStore.GetUploadsByIDs") - }, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: func(context.Context, ...int) ([]shared.Upload, error) { - panic("unexpected invocation of MockStore.GetUploadsByIDsAllowDeleted") - }, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) { - panic("unexpected invocation of MockStore.GetVisibleUploadsMatchingMonikers") - }, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: func() *basestore.Store { - panic("unexpected invocation of MockStore.Handle") - }, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: func(context.Context, ...int) error { - panic("unexpected invocation of MockStore.HardDeleteUploadsByIDs") - }, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: func(context.Context, api.RepoID, api.CommitID) (bool, error) { - panic("unexpected invocation of MockStore.HasCommit") - }, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: func(context.Context, api.RepoID) (bool, error) { - panic("unexpected invocation of MockStore.HasRepository") - }, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: func(context.Context, int) (int, error) { - panic("unexpected invocation of MockStore.InsertDependencySyncingJob") - }, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: func(context.Context, shared.Upload) (int, error) { - panic("unexpected invocation of MockStore.InsertUpload") - }, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: func(context.Context, int, string) error { - panic("unexpected invocation of MockStore.MarkFailed") - }, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: func(context.Context, int, *int64) error { - panic("unexpected invocation of MockStore.MarkQueued") - }, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: func(context.Context) (int, error) { - panic("unexpected invocation of MockStore.NumRepositoriesWithCodeIntelligence") - }, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - panic("unexpected invocation of MockStore.ProcessSourcedCommits") - }, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - panic("unexpected invocation of MockStore.ProcessStaleSourcedCommits") - }, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: func(context.Context, int) ([]int, error) { - panic("unexpected invocation of MockStore.ReconcileCandidates") - }, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: func(context.Context, int) (shared.PackageReferenceScanner, error) { - panic("unexpected invocation of MockStore.ReferencesForUpload") - }, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.ReindexUploadByID") - }, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: func(context.Context, shared.ReindexUploadsOptions) error { - panic("unexpected invocation of MockStore.ReindexUploads") - }, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) { - panic("unexpected invocation of MockStore.RepositoryIDsWithErrors") - }, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: func(context.Context, time.Duration, int) ([]int, error) { - panic("unexpected invocation of MockStore.SetRepositoriesForRetentionScan") - }, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.SetRepositoryAsDirty") - }, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: func(context.Context, int) error { - panic("unexpected invocation of MockStore.SetRerunAutoIndexJobByID") - }, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: func(context.Context, shared.SetRerunAutoIndexJobsOptions) error { - panic("unexpected invocation of MockStore.SetRerunAutoIndexJobs") - }, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: func(context.Context, int) (int, int, error) { - panic("unexpected invocation of MockStore.SoftDeleteExpiredUploads") - }, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: func(context.Context, int) (int, int, error) { - panic("unexpected invocation of MockStore.SoftDeleteExpiredUploadsViaTraversal") - }, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: func(context.Context, int) ([]store.SourcedCommits, error) { - panic("unexpected invocation of MockStore.SourcedCommitsWithoutCommittedAt") - }, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: func(context.Context, int, string, string) error { - panic("unexpected invocation of MockStore.UpdateCommittedAt") - }, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: func(context.Context, int, []precise.PackageReference) error { - panic("unexpected invocation of MockStore.UpdatePackageReferences") - }, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: func(context.Context, int, []precise.Package) error { - panic("unexpected invocation of MockStore.UpdatePackages") - }, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: func(context.Context, []int, []int) error { - panic("unexpected invocation of MockStore.UpdateUploadRetention") - }, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - panic("unexpected invocation of MockStore.UpdateUploadsVisibleToCommits") - }, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: func(context.Context, func(s store.Store) error) error { - panic("unexpected invocation of MockStore.WithTransaction") - }, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: func(*observation.Context) store1.Store[shared.Upload] { - panic("unexpected invocation of MockStore.WorkerutilStore") - }, - }, - } -} - -// NewMockStoreFrom creates a new mock of the MockStore interface. All -// methods delegate to the given implementation, unless overwritten. -func NewMockStoreFrom(i store.Store) *MockStore { - return &MockStore{ - AddUploadPartFunc: &StoreAddUploadPartFunc{ - defaultHook: i.AddUploadPart, - }, - DeleteAutoIndexJobByIDFunc: &StoreDeleteAutoIndexJobByIDFunc{ - defaultHook: i.DeleteAutoIndexJobByID, - }, - DeleteAutoIndexJobsFunc: &StoreDeleteAutoIndexJobsFunc{ - defaultHook: i.DeleteAutoIndexJobs, - }, - DeleteAutoIndexJobsWithoutRepositoryFunc: &StoreDeleteAutoIndexJobsWithoutRepositoryFunc{ - defaultHook: i.DeleteAutoIndexJobsWithoutRepository, - }, - DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{ - defaultHook: i.DeleteOldAuditLogs, - }, - DeleteOverlappingCompletedUploadsFunc: &StoreDeleteOverlappingCompletedUploadsFunc{ - defaultHook: i.DeleteOverlappingCompletedUploads, - }, - DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{ - defaultHook: i.DeleteUploadByID, - }, - DeleteUploadsFunc: &StoreDeleteUploadsFunc{ - defaultHook: i.DeleteUploads, - }, - DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{ - defaultHook: i.DeleteUploadsStuckUploading, - }, - DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{ - defaultHook: i.DeleteUploadsWithoutRepository, - }, - ExpireFailedRecordsFunc: &StoreExpireFailedRecordsFunc{ - defaultHook: i.ExpireFailedRecords, - }, - FindClosestCompletedUploadsFunc: &StoreFindClosestCompletedUploadsFunc{ - defaultHook: i.FindClosestCompletedUploads, - }, - FindClosestCompletedUploadsFromGraphFragmentFunc: &StoreFindClosestCompletedUploadsFromGraphFragmentFunc{ - defaultHook: i.FindClosestCompletedUploadsFromGraphFragment, - }, - GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{ - defaultHook: i.GetAuditLogsForUpload, - }, - GetAutoIndexJobByIDFunc: &StoreGetAutoIndexJobByIDFunc{ - defaultHook: i.GetAutoIndexJobByID, - }, - GetAutoIndexJobsFunc: &StoreGetAutoIndexJobsFunc{ - defaultHook: i.GetAutoIndexJobs, - }, - GetAutoIndexJobsByIDsFunc: &StoreGetAutoIndexJobsByIDsFunc{ - defaultHook: i.GetAutoIndexJobsByIDs, - }, - GetCommitAndDateForOldestUploadFunc: &StoreGetCommitAndDateForOldestUploadFunc{ - defaultHook: i.GetCommitAndDateForOldestUpload, - }, - GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{ - defaultHook: i.GetCommitGraphMetadata, - }, - GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{ - defaultHook: i.GetCommitsVisibleToUpload, - }, - GetCompletedUploadsByIDsFunc: &StoreGetCompletedUploadsByIDsFunc{ - defaultHook: i.GetCompletedUploadsByIDs, - }, - GetCompletedUploadsWithDefinitionsForMonikersFunc: &StoreGetCompletedUploadsWithDefinitionsForMonikersFunc{ - defaultHook: i.GetCompletedUploadsWithDefinitionsForMonikers, - }, - GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{ - defaultHook: i.GetDirtyRepositories, - }, - GetIndexersFunc: &StoreGetIndexersFunc{ - defaultHook: i.GetIndexers, - }, - GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{ - defaultHook: i.GetLastUploadRetentionScanForRepository, - }, - GetRecentAutoIndexJobsSummaryFunc: &StoreGetRecentAutoIndexJobsSummaryFunc{ - defaultHook: i.GetRecentAutoIndexJobsSummary, - }, - GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{ - defaultHook: i.GetRecentUploadsSummary, - }, - GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{ - defaultHook: i.GetRepositoriesMaxStaleAge, - }, - GetUploadByIDFunc: &StoreGetUploadByIDFunc{ - defaultHook: i.GetUploadByID, - }, - GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{ - defaultHook: i.GetUploadIDsWithReferences, - }, - GetUploadsFunc: &StoreGetUploadsFunc{ - defaultHook: i.GetUploads, - }, - GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{ - defaultHook: i.GetUploadsByIDs, - }, - GetUploadsByIDsAllowDeletedFunc: &StoreGetUploadsByIDsAllowDeletedFunc{ - defaultHook: i.GetUploadsByIDsAllowDeleted, - }, - GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{ - defaultHook: i.GetVisibleUploadsMatchingMonikers, - }, - HandleFunc: &StoreHandleFunc{ - defaultHook: i.Handle, - }, - HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{ - defaultHook: i.HardDeleteUploadsByIDs, - }, - HasCommitFunc: &StoreHasCommitFunc{ - defaultHook: i.HasCommit, - }, - HasRepositoryFunc: &StoreHasRepositoryFunc{ - defaultHook: i.HasRepository, - }, - InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{ - defaultHook: i.InsertDependencySyncingJob, - }, - InsertUploadFunc: &StoreInsertUploadFunc{ - defaultHook: i.InsertUpload, - }, - MarkFailedFunc: &StoreMarkFailedFunc{ - defaultHook: i.MarkFailed, - }, - MarkQueuedFunc: &StoreMarkQueuedFunc{ - defaultHook: i.MarkQueued, - }, - NumRepositoriesWithCodeIntelligenceFunc: &StoreNumRepositoriesWithCodeIntelligenceFunc{ - defaultHook: i.NumRepositoriesWithCodeIntelligence, - }, - ProcessSourcedCommitsFunc: &StoreProcessSourcedCommitsFunc{ - defaultHook: i.ProcessSourcedCommits, - }, - ProcessStaleSourcedCommitsFunc: &StoreProcessStaleSourcedCommitsFunc{ - defaultHook: i.ProcessStaleSourcedCommits, - }, - ReconcileCandidatesFunc: &StoreReconcileCandidatesFunc{ - defaultHook: i.ReconcileCandidates, - }, - ReferencesForUploadFunc: &StoreReferencesForUploadFunc{ - defaultHook: i.ReferencesForUpload, - }, - ReindexUploadByIDFunc: &StoreReindexUploadByIDFunc{ - defaultHook: i.ReindexUploadByID, - }, - ReindexUploadsFunc: &StoreReindexUploadsFunc{ - defaultHook: i.ReindexUploads, - }, - RepositoryIDsWithErrorsFunc: &StoreRepositoryIDsWithErrorsFunc{ - defaultHook: i.RepositoryIDsWithErrors, - }, - SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{ - defaultHook: i.SetRepositoriesForRetentionScan, - }, - SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{ - defaultHook: i.SetRepositoryAsDirty, - }, - SetRerunAutoIndexJobByIDFunc: &StoreSetRerunAutoIndexJobByIDFunc{ - defaultHook: i.SetRerunAutoIndexJobByID, - }, - SetRerunAutoIndexJobsFunc: &StoreSetRerunAutoIndexJobsFunc{ - defaultHook: i.SetRerunAutoIndexJobs, - }, - SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{ - defaultHook: i.SoftDeleteExpiredUploads, - }, - SoftDeleteExpiredUploadsViaTraversalFunc: &StoreSoftDeleteExpiredUploadsViaTraversalFunc{ - defaultHook: i.SoftDeleteExpiredUploadsViaTraversal, - }, - SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{ - defaultHook: i.SourcedCommitsWithoutCommittedAt, - }, - UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{ - defaultHook: i.UpdateCommittedAt, - }, - UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{ - defaultHook: i.UpdatePackageReferences, - }, - UpdatePackagesFunc: &StoreUpdatePackagesFunc{ - defaultHook: i.UpdatePackages, - }, - UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{ - defaultHook: i.UpdateUploadRetention, - }, - UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{ - defaultHook: i.UpdateUploadsVisibleToCommits, - }, - WithTransactionFunc: &StoreWithTransactionFunc{ - defaultHook: i.WithTransaction, - }, - WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{ - defaultHook: i.WorkerutilStore, - }, - } -} - -// StoreAddUploadPartFunc describes the behavior when the AddUploadPart -// method of the parent MockStore instance is invoked. -type StoreAddUploadPartFunc struct { - defaultHook func(context.Context, int, int) error - hooks []func(context.Context, int, int) error - history []StoreAddUploadPartFuncCall - mutex sync.Mutex -} - -// AddUploadPart delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) AddUploadPart(v0 context.Context, v1 int, v2 int) error { - r0 := m.AddUploadPartFunc.nextHook()(v0, v1, v2) - m.AddUploadPartFunc.appendCall(StoreAddUploadPartFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the AddUploadPart method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreAddUploadPartFunc) SetDefaultHook(hook func(context.Context, int, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// AddUploadPart method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreAddUploadPartFunc) PushHook(hook func(context.Context, int, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreAddUploadPartFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreAddUploadPartFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, int) error { - return r0 - }) -} - -func (f *StoreAddUploadPartFunc) nextHook() func(context.Context, int, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreAddUploadPartFunc) appendCall(r0 StoreAddUploadPartFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreAddUploadPartFuncCall objects -// describing the invocations of this function. -func (f *StoreAddUploadPartFunc) History() []StoreAddUploadPartFuncCall { - f.mutex.Lock() - history := make([]StoreAddUploadPartFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreAddUploadPartFuncCall is an object that describes an invocation of -// method AddUploadPart on an instance of MockStore. -type StoreAddUploadPartFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreAddUploadPartFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreAddUploadPartFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteAutoIndexJobByIDFunc describes the behavior when the -// DeleteAutoIndexJobByID method of the parent MockStore instance is -// invoked. -type StoreDeleteAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) (bool, error) - hooks []func(context.Context, int) (bool, error) - history []StoreDeleteAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobByID delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteAutoIndexJobByID(v0 context.Context, v1 int) (bool, error) { - r0, r1 := m.DeleteAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobByIDFunc.appendCall(StoreDeleteAutoIndexJobByIDFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// DeleteAutoIndexJobByID method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreDeleteAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobByID method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreDeleteAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobByIDFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobByIDFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreDeleteAutoIndexJobByIDFunc) nextHook() func(context.Context, int) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobByIDFunc) appendCall(r0 StoreDeleteAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteAutoIndexJobByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteAutoIndexJobByIDFunc) History() []StoreDeleteAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method DeleteAutoIndexJobByID on an instance of MockStore. -type StoreDeleteAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreDeleteAutoIndexJobsFunc describes the behavior when the -// DeleteAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreDeleteAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared.DeleteAutoIndexJobsOptions) error - hooks []func(context.Context, shared.DeleteAutoIndexJobsOptions) error - history []StoreDeleteAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteAutoIndexJobs(v0 context.Context, v1 shared.DeleteAutoIndexJobsOptions) error { - r0 := m.DeleteAutoIndexJobsFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobsFunc.appendCall(StoreDeleteAutoIndexJobsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the DeleteAutoIndexJobs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared.DeleteAutoIndexJobsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreDeleteAutoIndexJobsFunc) PushHook(hook func(context.Context, shared.DeleteAutoIndexJobsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared.DeleteAutoIndexJobsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared.DeleteAutoIndexJobsOptions) error { - return r0 - }) -} - -func (f *StoreDeleteAutoIndexJobsFunc) nextHook() func(context.Context, shared.DeleteAutoIndexJobsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobsFunc) appendCall(r0 StoreDeleteAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteAutoIndexJobsFunc) History() []StoreDeleteAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobsFuncCall is an object that describes an -// invocation of method DeleteAutoIndexJobs on an instance of MockStore. -type StoreDeleteAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.DeleteAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteAutoIndexJobsWithoutRepositoryFunc describes the behavior when -// the DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance is invoked. -type StoreDeleteAutoIndexJobsWithoutRepositoryFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall - mutex sync.Mutex -} - -// DeleteAutoIndexJobsWithoutRepository delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) DeleteAutoIndexJobsWithoutRepository(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteAutoIndexJobsWithoutRepositoryFunc.nextHook()(v0, v1) - m.DeleteAutoIndexJobsWithoutRepositoryFunc.appendCall(StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteAutoIndexJobsWithoutRepository method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) appendCall(r0 StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall objects describing the -// invocations of this function. -func (f *StoreDeleteAutoIndexJobsWithoutRepositoryFunc) History() []StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall is an object that -// describes an invocation of method DeleteAutoIndexJobsWithoutRepository on -// an instance of MockStore. -type StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteAutoIndexJobsWithoutRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteOldAuditLogsFunc describes the behavior when the -// DeleteOldAuditLogs method of the parent MockStore instance is invoked. -type StoreDeleteOldAuditLogsFunc struct { - defaultHook func(context.Context, time.Duration, time.Time) (int, int, error) - hooks []func(context.Context, time.Duration, time.Time) (int, int, error) - history []StoreDeleteOldAuditLogsFuncCall - mutex sync.Mutex -} - -// DeleteOldAuditLogs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteOldAuditLogs(v0 context.Context, v1 time.Duration, v2 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteOldAuditLogsFunc.nextHook()(v0, v1, v2) - m.DeleteOldAuditLogsFunc.appendCall(StoreDeleteOldAuditLogsFuncCall{v0, v1, v2, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the DeleteOldAuditLogs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteOldAuditLogsFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteOldAuditLogs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreDeleteOldAuditLogsFunc) PushHook(hook func(context.Context, time.Duration, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteOldAuditLogsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteOldAuditLogsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteOldAuditLogsFunc) nextHook() func(context.Context, time.Duration, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteOldAuditLogsFunc) appendCall(r0 StoreDeleteOldAuditLogsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteOldAuditLogsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteOldAuditLogsFunc) History() []StoreDeleteOldAuditLogsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteOldAuditLogsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteOldAuditLogsFuncCall is an object that describes an invocation -// of method DeleteOldAuditLogs on an instance of MockStore. -type StoreDeleteOldAuditLogsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteOldAuditLogsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteOldAuditLogsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteOverlappingCompletedUploadsFunc describes the behavior when -// the DeleteOverlappingCompletedUploads method of the parent MockStore -// instance is invoked. -type StoreDeleteOverlappingCompletedUploadsFunc struct { - defaultHook func(context.Context, int, string, string, string) error - hooks []func(context.Context, int, string, string, string) error - history []StoreDeleteOverlappingCompletedUploadsFuncCall - mutex sync.Mutex -} - -// DeleteOverlappingCompletedUploads delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteOverlappingCompletedUploads(v0 context.Context, v1 int, v2 string, v3 string, v4 string) error { - r0 := m.DeleteOverlappingCompletedUploadsFunc.nextHook()(v0, v1, v2, v3, v4) - m.DeleteOverlappingCompletedUploadsFunc.appendCall(StoreDeleteOverlappingCompletedUploadsFuncCall{v0, v1, v2, v3, v4, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// DeleteOverlappingCompletedUploads method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) SetDefaultHook(hook func(context.Context, int, string, string, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteOverlappingCompletedUploads method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) PushHook(hook func(context.Context, int, string, string, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string, string, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string, string, string) error { - return r0 - }) -} - -func (f *StoreDeleteOverlappingCompletedUploadsFunc) nextHook() func(context.Context, int, string, string, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteOverlappingCompletedUploadsFunc) appendCall(r0 StoreDeleteOverlappingCompletedUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreDeleteOverlappingCompletedUploadsFuncCall objects describing the -// invocations of this function. -func (f *StoreDeleteOverlappingCompletedUploadsFunc) History() []StoreDeleteOverlappingCompletedUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteOverlappingCompletedUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteOverlappingCompletedUploadsFuncCall is an object that -// describes an invocation of method DeleteOverlappingCompletedUploads on an -// instance of MockStore. -type StoreDeleteOverlappingCompletedUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 string - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteOverlappingCompletedUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteOverlappingCompletedUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteUploadByIDFunc describes the behavior when the -// DeleteUploadByID method of the parent MockStore instance is invoked. -type StoreDeleteUploadByIDFunc struct { - defaultHook func(context.Context, int) (bool, error) - hooks []func(context.Context, int) (bool, error) - history []StoreDeleteUploadByIDFuncCall - mutex sync.Mutex -} - -// DeleteUploadByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadByID(v0 context.Context, v1 int) (bool, error) { - r0, r1 := m.DeleteUploadByIDFunc.nextHook()(v0, v1) - m.DeleteUploadByIDFunc.appendCall(StoreDeleteUploadByIDFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the DeleteUploadByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreDeleteUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadByID method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreDeleteUploadByIDFunc) PushHook(hook func(context.Context, int) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadByIDFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadByIDFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreDeleteUploadByIDFunc) nextHook() func(context.Context, int) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadByIDFunc) appendCall(r0 StoreDeleteUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteUploadByIDFunc) History() []StoreDeleteUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadByIDFuncCall is an object that describes an invocation -// of method DeleteUploadByID on an instance of MockStore. -type StoreDeleteUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreDeleteUploadsFunc describes the behavior when the DeleteUploads -// method of the parent MockStore instance is invoked. -type StoreDeleteUploadsFunc struct { - defaultHook func(context.Context, shared.DeleteUploadsOptions) error - hooks []func(context.Context, shared.DeleteUploadsOptions) error - history []StoreDeleteUploadsFuncCall - mutex sync.Mutex -} - -// DeleteUploads delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) DeleteUploads(v0 context.Context, v1 shared.DeleteUploadsOptions) error { - r0 := m.DeleteUploadsFunc.nextHook()(v0, v1) - m.DeleteUploadsFunc.appendCall(StoreDeleteUploadsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the DeleteUploads method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreDeleteUploadsFunc) SetDefaultHook(hook func(context.Context, shared.DeleteUploadsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploads method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreDeleteUploadsFunc) PushHook(hook func(context.Context, shared.DeleteUploadsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared.DeleteUploadsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared.DeleteUploadsOptions) error { - return r0 - }) -} - -func (f *StoreDeleteUploadsFunc) nextHook() func(context.Context, shared.DeleteUploadsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsFunc) appendCall(r0 StoreDeleteUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsFuncCall objects -// describing the invocations of this function. -func (f *StoreDeleteUploadsFunc) History() []StoreDeleteUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsFuncCall is an object that describes an invocation of -// method DeleteUploads on an instance of MockStore. -type StoreDeleteUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.DeleteUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreDeleteUploadsStuckUploadingFunc describes the behavior when the -// DeleteUploadsStuckUploading method of the parent MockStore instance is -// invoked. -type StoreDeleteUploadsStuckUploadingFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteUploadsStuckUploadingFuncCall - mutex sync.Mutex -} - -// DeleteUploadsStuckUploading delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadsStuckUploading(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteUploadsStuckUploadingFunc.nextHook()(v0, v1) - m.DeleteUploadsStuckUploadingFunc.appendCall(StoreDeleteUploadsStuckUploadingFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteUploadsStuckUploading method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreDeleteUploadsStuckUploadingFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadsStuckUploading method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteUploadsStuckUploadingFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsStuckUploadingFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsStuckUploadingFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteUploadsStuckUploadingFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsStuckUploadingFunc) appendCall(r0 StoreDeleteUploadsStuckUploadingFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsStuckUploadingFuncCall -// objects describing the invocations of this function. -func (f *StoreDeleteUploadsStuckUploadingFunc) History() []StoreDeleteUploadsStuckUploadingFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsStuckUploadingFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsStuckUploadingFuncCall is an object that describes an -// invocation of method DeleteUploadsStuckUploading on an instance of -// MockStore. -type StoreDeleteUploadsStuckUploadingFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsStuckUploadingFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsStuckUploadingFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreDeleteUploadsWithoutRepositoryFunc describes the behavior when the -// DeleteUploadsWithoutRepository method of the parent MockStore instance is -// invoked. -type StoreDeleteUploadsWithoutRepositoryFunc struct { - defaultHook func(context.Context, time.Time) (int, int, error) - hooks []func(context.Context, time.Time) (int, int, error) - history []StoreDeleteUploadsWithoutRepositoryFuncCall - mutex sync.Mutex -} - -// DeleteUploadsWithoutRepository delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) DeleteUploadsWithoutRepository(v0 context.Context, v1 time.Time) (int, int, error) { - r0, r1, r2 := m.DeleteUploadsWithoutRepositoryFunc.nextHook()(v0, v1) - m.DeleteUploadsWithoutRepositoryFunc.appendCall(StoreDeleteUploadsWithoutRepositoryFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// DeleteUploadsWithoutRepository method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// DeleteUploadsWithoutRepository method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreDeleteUploadsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreDeleteUploadsWithoutRepositoryFunc) appendCall(r0 StoreDeleteUploadsWithoutRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreDeleteUploadsWithoutRepositoryFuncCall -// objects describing the invocations of this function. -func (f *StoreDeleteUploadsWithoutRepositoryFunc) History() []StoreDeleteUploadsWithoutRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreDeleteUploadsWithoutRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreDeleteUploadsWithoutRepositoryFuncCall is an object that describes -// an invocation of method DeleteUploadsWithoutRepository on an instance of -// MockStore. -type StoreDeleteUploadsWithoutRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreDeleteUploadsWithoutRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreDeleteUploadsWithoutRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreExpireFailedRecordsFunc describes the behavior when the -// ExpireFailedRecords method of the parent MockStore instance is invoked. -type StoreExpireFailedRecordsFunc struct { - defaultHook func(context.Context, int, time.Duration, time.Time) (int, int, error) - hooks []func(context.Context, int, time.Duration, time.Time) (int, int, error) - history []StoreExpireFailedRecordsFuncCall - mutex sync.Mutex -} - -// ExpireFailedRecords delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ExpireFailedRecords(v0 context.Context, v1 int, v2 time.Duration, v3 time.Time) (int, int, error) { - r0, r1, r2 := m.ExpireFailedRecordsFunc.nextHook()(v0, v1, v2, v3) - m.ExpireFailedRecordsFunc.appendCall(StoreExpireFailedRecordsFuncCall{v0, v1, v2, v3, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the ExpireFailedRecords -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreExpireFailedRecordsFunc) SetDefaultHook(hook func(context.Context, int, time.Duration, time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ExpireFailedRecords method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreExpireFailedRecordsFunc) PushHook(hook func(context.Context, int, time.Duration, time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreExpireFailedRecordsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreExpireFailedRecordsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int, time.Duration, time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreExpireFailedRecordsFunc) nextHook() func(context.Context, int, time.Duration, time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreExpireFailedRecordsFunc) appendCall(r0 StoreExpireFailedRecordsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreExpireFailedRecordsFuncCall objects -// describing the invocations of this function. -func (f *StoreExpireFailedRecordsFunc) History() []StoreExpireFailedRecordsFuncCall { - f.mutex.Lock() - history := make([]StoreExpireFailedRecordsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreExpireFailedRecordsFuncCall is an object that describes an -// invocation of method ExpireFailedRecords on an instance of MockStore. -type StoreExpireFailedRecordsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Duration - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreExpireFailedRecordsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreExpireFailedRecordsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreFindClosestCompletedUploadsFunc describes the behavior when the -// FindClosestCompletedUploads method of the parent MockStore instance is -// invoked. -type StoreFindClosestCompletedUploadsFunc struct { - defaultHook func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) - hooks []func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) - history []StoreFindClosestCompletedUploadsFuncCall - mutex sync.Mutex -} - -// FindClosestCompletedUploads delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) FindClosestCompletedUploads(v0 context.Context, v1 shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) { - r0, r1 := m.FindClosestCompletedUploadsFunc.nextHook()(v0, v1) - m.FindClosestCompletedUploadsFunc.appendCall(StoreFindClosestCompletedUploadsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// FindClosestCompletedUploads method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreFindClosestCompletedUploadsFunc) SetDefaultHook(hook func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// FindClosestCompletedUploads method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreFindClosestCompletedUploadsFunc) PushHook(hook func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreFindClosestCompletedUploadsFunc) SetDefaultReturn(r0 []shared.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreFindClosestCompletedUploadsFunc) PushReturn(r0 []shared.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreFindClosestCompletedUploadsFunc) nextHook() func(context.Context, shared.UploadMatchingOptions) ([]shared.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreFindClosestCompletedUploadsFunc) appendCall(r0 StoreFindClosestCompletedUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreFindClosestCompletedUploadsFuncCall -// objects describing the invocations of this function. -func (f *StoreFindClosestCompletedUploadsFunc) History() []StoreFindClosestCompletedUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreFindClosestCompletedUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreFindClosestCompletedUploadsFuncCall is an object that describes an -// invocation of method FindClosestCompletedUploads on an instance of -// MockStore. -type StoreFindClosestCompletedUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.UploadMatchingOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreFindClosestCompletedUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreFindClosestCompletedUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreFindClosestCompletedUploadsFromGraphFragmentFunc describes the -// behavior when the FindClosestCompletedUploadsFromGraphFragment method of -// the parent MockStore instance is invoked. -type StoreFindClosestCompletedUploadsFromGraphFragmentFunc struct { - defaultHook func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) - hooks []func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) - history []StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall - mutex sync.Mutex -} - -// FindClosestCompletedUploadsFromGraphFragment delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) FindClosestCompletedUploadsFromGraphFragment(v0 context.Context, v1 shared.UploadMatchingOptions, v2 *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) { - r0, r1 := m.FindClosestCompletedUploadsFromGraphFragmentFunc.nextHook()(v0, v1, v2) - m.FindClosestCompletedUploadsFromGraphFragmentFunc.appendCall(StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// FindClosestCompletedUploadsFromGraphFragment method of the parent -// MockStore instance is invoked and the hook queue is empty. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) SetDefaultHook(hook func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// FindClosestCompletedUploadsFromGraphFragment method of the parent -// MockStore instance invokes the hook at the front of the queue and -// discards it. After the queue is empty, the default hook function is -// invoked for any future action. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) PushHook(hook func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) SetDefaultReturn(r0 []shared.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) PushReturn(r0 []shared.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) nextHook() func(context.Context, shared.UploadMatchingOptions, *commitgraph.CommitGraph) ([]shared.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) appendCall(r0 StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall objects -// describing the invocations of this function. -func (f *StoreFindClosestCompletedUploadsFromGraphFragmentFunc) History() []StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall { - f.mutex.Lock() - history := make([]StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall is an object -// that describes an invocation of method -// FindClosestCompletedUploadsFromGraphFragment on an instance of MockStore. -type StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.UploadMatchingOptions - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *commitgraph.CommitGraph - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreFindClosestCompletedUploadsFromGraphFragmentFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetAuditLogsForUploadFunc describes the behavior when the -// GetAuditLogsForUpload method of the parent MockStore instance is invoked. -type StoreGetAuditLogsForUploadFunc struct { - defaultHook func(context.Context, int) ([]shared.UploadLog, error) - hooks []func(context.Context, int) ([]shared.UploadLog, error) - history []StoreGetAuditLogsForUploadFuncCall - mutex sync.Mutex -} - -// GetAuditLogsForUpload delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetAuditLogsForUpload(v0 context.Context, v1 int) ([]shared.UploadLog, error) { - r0, r1 := m.GetAuditLogsForUploadFunc.nextHook()(v0, v1) - m.GetAuditLogsForUploadFunc.appendCall(StoreGetAuditLogsForUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetAuditLogsForUpload method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetAuditLogsForUploadFunc) SetDefaultHook(hook func(context.Context, int) ([]shared.UploadLog, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAuditLogsForUpload method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAuditLogsForUploadFunc) PushHook(hook func(context.Context, int) ([]shared.UploadLog, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAuditLogsForUploadFunc) SetDefaultReturn(r0 []shared.UploadLog, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared.UploadLog, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAuditLogsForUploadFunc) PushReturn(r0 []shared.UploadLog, r1 error) { - f.PushHook(func(context.Context, int) ([]shared.UploadLog, error) { - return r0, r1 - }) -} - -func (f *StoreGetAuditLogsForUploadFunc) nextHook() func(context.Context, int) ([]shared.UploadLog, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAuditLogsForUploadFunc) appendCall(r0 StoreGetAuditLogsForUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAuditLogsForUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAuditLogsForUploadFunc) History() []StoreGetAuditLogsForUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetAuditLogsForUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAuditLogsForUploadFuncCall is an object that describes an -// invocation of method GetAuditLogsForUpload on an instance of MockStore. -type StoreGetAuditLogsForUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.UploadLog - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAuditLogsForUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAuditLogsForUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetAutoIndexJobByIDFunc describes the behavior when the -// GetAutoIndexJobByID method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) (shared.AutoIndexJob, bool, error) - hooks []func(context.Context, int) (shared.AutoIndexJob, bool, error) - history []StoreGetAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobByID(v0 context.Context, v1 int) (shared.AutoIndexJob, bool, error) { - r0, r1, r2 := m.GetAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.GetAutoIndexJobByIDFunc.appendCall(StoreGetAutoIndexJobByIDFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetAutoIndexJobByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) (shared.AutoIndexJob, bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobByID method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) (shared.AutoIndexJob, bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobByIDFunc) SetDefaultReturn(r0 shared.AutoIndexJob, r1 bool, r2 error) { - f.SetDefaultHook(func(context.Context, int) (shared.AutoIndexJob, bool, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobByIDFunc) PushReturn(r0 shared.AutoIndexJob, r1 bool, r2 error) { - f.PushHook(func(context.Context, int) (shared.AutoIndexJob, bool, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetAutoIndexJobByIDFunc) nextHook() func(context.Context, int) (shared.AutoIndexJob, bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobByIDFunc) appendCall(r0 StoreGetAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobByIDFunc) History() []StoreGetAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method GetAutoIndexJobByID on an instance of MockStore. -type StoreGetAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 bool - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetAutoIndexJobsFunc describes the behavior when the -// GetAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) - hooks []func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) - history []StoreGetAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobs(v0 context.Context, v1 shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) { - r0, r1, r2 := m.GetAutoIndexJobsFunc.nextHook()(v0, v1) - m.GetAutoIndexJobsFunc.appendCall(StoreGetAutoIndexJobsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetAutoIndexJobs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobs method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobsFunc) PushHook(hook func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobsFunc) SetDefaultReturn(r0 []shared.AutoIndexJob, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobsFunc) PushReturn(r0 []shared.AutoIndexJob, r1 int, r2 error) { - f.PushHook(func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetAutoIndexJobsFunc) nextHook() func(context.Context, shared.GetAutoIndexJobsOptions) ([]shared.AutoIndexJob, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobsFunc) appendCall(r0 StoreGetAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobsFunc) History() []StoreGetAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobsFuncCall is an object that describes an invocation -// of method GetAutoIndexJobs on an instance of MockStore. -type StoreGetAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.GetAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetAutoIndexJobsByIDsFunc describes the behavior when the -// GetAutoIndexJobsByIDs method of the parent MockStore instance is invoked. -type StoreGetAutoIndexJobsByIDsFunc struct { - defaultHook func(context.Context, ...int) ([]shared.AutoIndexJob, error) - hooks []func(context.Context, ...int) ([]shared.AutoIndexJob, error) - history []StoreGetAutoIndexJobsByIDsFuncCall - mutex sync.Mutex -} - -// GetAutoIndexJobsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetAutoIndexJobsByIDs(v0 context.Context, v1 ...int) ([]shared.AutoIndexJob, error) { - r0, r1 := m.GetAutoIndexJobsByIDsFunc.nextHook()(v0, v1...) - m.GetAutoIndexJobsByIDsFunc.appendCall(StoreGetAutoIndexJobsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetAutoIndexJobsByIDs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetAutoIndexJobsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared.AutoIndexJob, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetAutoIndexJobsByIDs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetAutoIndexJobsByIDsFunc) PushHook(hook func(context.Context, ...int) ([]shared.AutoIndexJob, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetAutoIndexJobsByIDsFunc) SetDefaultReturn(r0 []shared.AutoIndexJob, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared.AutoIndexJob, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetAutoIndexJobsByIDsFunc) PushReturn(r0 []shared.AutoIndexJob, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared.AutoIndexJob, error) { - return r0, r1 - }) -} - -func (f *StoreGetAutoIndexJobsByIDsFunc) nextHook() func(context.Context, ...int) ([]shared.AutoIndexJob, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetAutoIndexJobsByIDsFunc) appendCall(r0 StoreGetAutoIndexJobsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetAutoIndexJobsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetAutoIndexJobsByIDsFunc) History() []StoreGetAutoIndexJobsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetAutoIndexJobsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetAutoIndexJobsByIDsFuncCall is an object that describes an -// invocation of method GetAutoIndexJobsByIDs on an instance of MockStore. -type StoreGetAutoIndexJobsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.AutoIndexJob - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetAutoIndexJobsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetAutoIndexJobsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCommitAndDateForOldestUploadFunc describes the behavior when the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// is invoked. -type StoreGetCommitAndDateForOldestUploadFunc struct { - defaultHook func(context.Context, int) (core.Option[store.CommitWithDate], error) - hooks []func(context.Context, int) (core.Option[store.CommitWithDate], error) - history []StoreGetCommitAndDateForOldestUploadFuncCall - mutex sync.Mutex -} - -// GetCommitAndDateForOldestUpload delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitAndDateForOldestUpload(v0 context.Context, v1 int) (core.Option[store.CommitWithDate], error) { - r0, r1 := m.GetCommitAndDateForOldestUploadFunc.nextHook()(v0, v1) - m.GetCommitAndDateForOldestUploadFunc.appendCall(StoreGetCommitAndDateForOldestUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreGetCommitAndDateForOldestUploadFunc) SetDefaultHook(hook func(context.Context, int) (core.Option[store.CommitWithDate], error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitAndDateForOldestUpload method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetCommitAndDateForOldestUploadFunc) PushHook(hook func(context.Context, int) (core.Option[store.CommitWithDate], error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitAndDateForOldestUploadFunc) SetDefaultReturn(r0 core.Option[store.CommitWithDate], r1 error) { - f.SetDefaultHook(func(context.Context, int) (core.Option[store.CommitWithDate], error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitAndDateForOldestUploadFunc) PushReturn(r0 core.Option[store.CommitWithDate], r1 error) { - f.PushHook(func(context.Context, int) (core.Option[store.CommitWithDate], error) { - return r0, r1 - }) -} - -func (f *StoreGetCommitAndDateForOldestUploadFunc) nextHook() func(context.Context, int) (core.Option[store.CommitWithDate], error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitAndDateForOldestUploadFunc) appendCall(r0 StoreGetCommitAndDateForOldestUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetCommitAndDateForOldestUploadFuncCall objects describing the -// invocations of this function. -func (f *StoreGetCommitAndDateForOldestUploadFunc) History() []StoreGetCommitAndDateForOldestUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitAndDateForOldestUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitAndDateForOldestUploadFuncCall is an object that describes -// an invocation of method GetCommitAndDateForOldestUpload on an instance of -// MockStore. -type StoreGetCommitAndDateForOldestUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 core.Option[store.CommitWithDate] - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitAndDateForOldestUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitAndDateForOldestUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCommitGraphMetadataFunc describes the behavior when the -// GetCommitGraphMetadata method of the parent MockStore instance is -// invoked. -type StoreGetCommitGraphMetadataFunc struct { - defaultHook func(context.Context, int) (bool, *time.Time, error) - hooks []func(context.Context, int) (bool, *time.Time, error) - history []StoreGetCommitGraphMetadataFuncCall - mutex sync.Mutex -} - -// GetCommitGraphMetadata delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitGraphMetadata(v0 context.Context, v1 int) (bool, *time.Time, error) { - r0, r1, r2 := m.GetCommitGraphMetadataFunc.nextHook()(v0, v1) - m.GetCommitGraphMetadataFunc.appendCall(StoreGetCommitGraphMetadataFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetCommitGraphMetadata method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreGetCommitGraphMetadataFunc) SetDefaultHook(hook func(context.Context, int) (bool, *time.Time, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitGraphMetadata method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCommitGraphMetadataFunc) PushHook(hook func(context.Context, int) (bool, *time.Time, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitGraphMetadataFunc) SetDefaultReturn(r0 bool, r1 *time.Time, r2 error) { - f.SetDefaultHook(func(context.Context, int) (bool, *time.Time, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitGraphMetadataFunc) PushReturn(r0 bool, r1 *time.Time, r2 error) { - f.PushHook(func(context.Context, int) (bool, *time.Time, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetCommitGraphMetadataFunc) nextHook() func(context.Context, int) (bool, *time.Time, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitGraphMetadataFunc) appendCall(r0 StoreGetCommitGraphMetadataFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCommitGraphMetadataFuncCall objects -// describing the invocations of this function. -func (f *StoreGetCommitGraphMetadataFunc) History() []StoreGetCommitGraphMetadataFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitGraphMetadataFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitGraphMetadataFuncCall is an object that describes an -// invocation of method GetCommitGraphMetadata on an instance of MockStore. -type StoreGetCommitGraphMetadataFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 *time.Time - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitGraphMetadataFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitGraphMetadataFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetCommitsVisibleToUploadFunc describes the behavior when the -// GetCommitsVisibleToUpload method of the parent MockStore instance is -// invoked. -type StoreGetCommitsVisibleToUploadFunc struct { - defaultHook func(context.Context, int, int, *string) ([]string, *string, error) - hooks []func(context.Context, int, int, *string) ([]string, *string, error) - history []StoreGetCommitsVisibleToUploadFuncCall - mutex sync.Mutex -} - -// GetCommitsVisibleToUpload delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetCommitsVisibleToUpload(v0 context.Context, v1 int, v2 int, v3 *string) ([]string, *string, error) { - r0, r1, r2 := m.GetCommitsVisibleToUploadFunc.nextHook()(v0, v1, v2, v3) - m.GetCommitsVisibleToUploadFunc.appendCall(StoreGetCommitsVisibleToUploadFuncCall{v0, v1, v2, v3, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetCommitsVisibleToUpload method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetCommitsVisibleToUploadFunc) SetDefaultHook(hook func(context.Context, int, int, *string) ([]string, *string, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCommitsVisibleToUpload method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCommitsVisibleToUploadFunc) PushHook(hook func(context.Context, int, int, *string) ([]string, *string, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCommitsVisibleToUploadFunc) SetDefaultReturn(r0 []string, r1 *string, r2 error) { - f.SetDefaultHook(func(context.Context, int, int, *string) ([]string, *string, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCommitsVisibleToUploadFunc) PushReturn(r0 []string, r1 *string, r2 error) { - f.PushHook(func(context.Context, int, int, *string) ([]string, *string, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetCommitsVisibleToUploadFunc) nextHook() func(context.Context, int, int, *string) ([]string, *string, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCommitsVisibleToUploadFunc) appendCall(r0 StoreGetCommitsVisibleToUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCommitsVisibleToUploadFuncCall -// objects describing the invocations of this function. -func (f *StoreGetCommitsVisibleToUploadFunc) History() []StoreGetCommitsVisibleToUploadFuncCall { - f.mutex.Lock() - history := make([]StoreGetCommitsVisibleToUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCommitsVisibleToUploadFuncCall is an object that describes an -// invocation of method GetCommitsVisibleToUpload on an instance of -// MockStore. -type StoreGetCommitsVisibleToUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 *string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []string - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 *string - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCommitsVisibleToUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCommitsVisibleToUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetCompletedUploadsByIDsFunc describes the behavior when the -// GetCompletedUploadsByIDs method of the parent MockStore instance is -// invoked. -type StoreGetCompletedUploadsByIDsFunc struct { - defaultHook func(context.Context, []int) ([]shared.CompletedUpload, error) - hooks []func(context.Context, []int) ([]shared.CompletedUpload, error) - history []StoreGetCompletedUploadsByIDsFuncCall - mutex sync.Mutex -} - -// GetCompletedUploadsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetCompletedUploadsByIDs(v0 context.Context, v1 []int) ([]shared.CompletedUpload, error) { - r0, r1 := m.GetCompletedUploadsByIDsFunc.nextHook()(v0, v1) - m.GetCompletedUploadsByIDsFunc.appendCall(StoreGetCompletedUploadsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCompletedUploadsByIDs method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetCompletedUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, []int) ([]shared.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCompletedUploadsByIDs method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetCompletedUploadsByIDsFunc) PushHook(hook func(context.Context, []int) ([]shared.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCompletedUploadsByIDsFunc) SetDefaultReturn(r0 []shared.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, []int) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCompletedUploadsByIDsFunc) PushReturn(r0 []shared.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, []int) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreGetCompletedUploadsByIDsFunc) nextHook() func(context.Context, []int) ([]shared.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCompletedUploadsByIDsFunc) appendCall(r0 StoreGetCompletedUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetCompletedUploadsByIDsFuncCall -// objects describing the invocations of this function. -func (f *StoreGetCompletedUploadsByIDsFunc) History() []StoreGetCompletedUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetCompletedUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCompletedUploadsByIDsFuncCall is an object that describes an -// invocation of method GetCompletedUploadsByIDs on an instance of -// MockStore. -type StoreGetCompletedUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCompletedUploadsByIDsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCompletedUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetCompletedUploadsWithDefinitionsForMonikersFunc describes the -// behavior when the GetCompletedUploadsWithDefinitionsForMonikers method of -// the parent MockStore instance is invoked. -type StoreGetCompletedUploadsWithDefinitionsForMonikersFunc struct { - defaultHook func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) - hooks []func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) - history []StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall - mutex sync.Mutex -} - -// GetCompletedUploadsWithDefinitionsForMonikers delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) GetCompletedUploadsWithDefinitionsForMonikers(v0 context.Context, v1 []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) { - r0, r1 := m.GetCompletedUploadsWithDefinitionsForMonikersFunc.nextHook()(v0, v1) - m.GetCompletedUploadsWithDefinitionsForMonikersFunc.appendCall(StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetCompletedUploadsWithDefinitionsForMonikers method of the parent -// MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) SetDefaultHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetCompletedUploadsWithDefinitionsForMonikers method of the parent -// MockStore instance invokes the hook at the front of the queue and -// discards it. After the queue is empty, the default hook function is -// invoked for any future action. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) PushHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) SetDefaultReturn(r0 []shared.CompletedUpload, r1 error) { - f.SetDefaultHook(func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) PushReturn(r0 []shared.CompletedUpload, r1 error) { - f.PushHook(func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) { - return r0, r1 - }) -} - -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) nextHook() func(context.Context, []precise.QualifiedMonikerData) ([]shared.CompletedUpload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) appendCall(r0 StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall objects -// describing the invocations of this function. -func (f *StoreGetCompletedUploadsWithDefinitionsForMonikersFunc) History() []StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall { - f.mutex.Lock() - history := make([]StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall is an object -// that describes an invocation of method -// GetCompletedUploadsWithDefinitionsForMonikers on an instance of -// MockStore. -type StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []precise.QualifiedMonikerData - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.CompletedUpload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetCompletedUploadsWithDefinitionsForMonikersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetDirtyRepositoriesFunc describes the behavior when the -// GetDirtyRepositories method of the parent MockStore instance is invoked. -type StoreGetDirtyRepositoriesFunc struct { - defaultHook func(context.Context) ([]shared.DirtyRepository, error) - hooks []func(context.Context) ([]shared.DirtyRepository, error) - history []StoreGetDirtyRepositoriesFuncCall - mutex sync.Mutex -} - -// GetDirtyRepositories delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetDirtyRepositories(v0 context.Context) ([]shared.DirtyRepository, error) { - r0, r1 := m.GetDirtyRepositoriesFunc.nextHook()(v0) - m.GetDirtyRepositoriesFunc.appendCall(StoreGetDirtyRepositoriesFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetDirtyRepositories -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetDirtyRepositoriesFunc) SetDefaultHook(hook func(context.Context) ([]shared.DirtyRepository, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetDirtyRepositories method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreGetDirtyRepositoriesFunc) PushHook(hook func(context.Context) ([]shared.DirtyRepository, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetDirtyRepositoriesFunc) SetDefaultReturn(r0 []shared.DirtyRepository, r1 error) { - f.SetDefaultHook(func(context.Context) ([]shared.DirtyRepository, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetDirtyRepositoriesFunc) PushReturn(r0 []shared.DirtyRepository, r1 error) { - f.PushHook(func(context.Context) ([]shared.DirtyRepository, error) { - return r0, r1 - }) -} - -func (f *StoreGetDirtyRepositoriesFunc) nextHook() func(context.Context) ([]shared.DirtyRepository, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetDirtyRepositoriesFunc) appendCall(r0 StoreGetDirtyRepositoriesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetDirtyRepositoriesFuncCall objects -// describing the invocations of this function. -func (f *StoreGetDirtyRepositoriesFunc) History() []StoreGetDirtyRepositoriesFuncCall { - f.mutex.Lock() - history := make([]StoreGetDirtyRepositoriesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetDirtyRepositoriesFuncCall is an object that describes an -// invocation of method GetDirtyRepositories on an instance of MockStore. -type StoreGetDirtyRepositoriesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.DirtyRepository - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetDirtyRepositoriesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetDirtyRepositoriesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetIndexersFunc describes the behavior when the GetIndexers method -// of the parent MockStore instance is invoked. -type StoreGetIndexersFunc struct { - defaultHook func(context.Context, shared.GetIndexersOptions) ([]string, error) - hooks []func(context.Context, shared.GetIndexersOptions) ([]string, error) - history []StoreGetIndexersFuncCall - mutex sync.Mutex -} - -// GetIndexers delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetIndexers(v0 context.Context, v1 shared.GetIndexersOptions) ([]string, error) { - r0, r1 := m.GetIndexersFunc.nextHook()(v0, v1) - m.GetIndexersFunc.appendCall(StoreGetIndexersFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetIndexers method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetIndexersFunc) SetDefaultHook(hook func(context.Context, shared.GetIndexersOptions) ([]string, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetIndexers method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetIndexersFunc) PushHook(hook func(context.Context, shared.GetIndexersOptions) ([]string, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetIndexersFunc) SetDefaultReturn(r0 []string, r1 error) { - f.SetDefaultHook(func(context.Context, shared.GetIndexersOptions) ([]string, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetIndexersFunc) PushReturn(r0 []string, r1 error) { - f.PushHook(func(context.Context, shared.GetIndexersOptions) ([]string, error) { - return r0, r1 - }) -} - -func (f *StoreGetIndexersFunc) nextHook() func(context.Context, shared.GetIndexersOptions) ([]string, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetIndexersFunc) appendCall(r0 StoreGetIndexersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetIndexersFuncCall objects describing -// the invocations of this function. -func (f *StoreGetIndexersFunc) History() []StoreGetIndexersFuncCall { - f.mutex.Lock() - history := make([]StoreGetIndexersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetIndexersFuncCall is an object that describes an invocation of -// method GetIndexers on an instance of MockStore. -type StoreGetIndexersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.GetIndexersOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []string - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetIndexersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetIndexersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetLastUploadRetentionScanForRepositoryFunc describes the behavior -// when the GetLastUploadRetentionScanForRepository method of the parent -// MockStore instance is invoked. -type StoreGetLastUploadRetentionScanForRepositoryFunc struct { - defaultHook func(context.Context, int) (*time.Time, error) - hooks []func(context.Context, int) (*time.Time, error) - history []StoreGetLastUploadRetentionScanForRepositoryFuncCall - mutex sync.Mutex -} - -// GetLastUploadRetentionScanForRepository delegates to the next hook -// function in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) GetLastUploadRetentionScanForRepository(v0 context.Context, v1 int) (*time.Time, error) { - r0, r1 := m.GetLastUploadRetentionScanForRepositoryFunc.nextHook()(v0, v1) - m.GetLastUploadRetentionScanForRepositoryFunc.appendCall(StoreGetLastUploadRetentionScanForRepositoryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetLastUploadRetentionScanForRepository method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) SetDefaultHook(hook func(context.Context, int) (*time.Time, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetLastUploadRetentionScanForRepository method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) PushHook(hook func(context.Context, int) (*time.Time, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) SetDefaultReturn(r0 *time.Time, r1 error) { - f.SetDefaultHook(func(context.Context, int) (*time.Time, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) PushReturn(r0 *time.Time, r1 error) { - f.PushHook(func(context.Context, int) (*time.Time, error) { - return r0, r1 - }) -} - -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) nextHook() func(context.Context, int) (*time.Time, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) appendCall(r0 StoreGetLastUploadRetentionScanForRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetLastUploadRetentionScanForRepositoryFuncCall objects describing -// the invocations of this function. -func (f *StoreGetLastUploadRetentionScanForRepositoryFunc) History() []StoreGetLastUploadRetentionScanForRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreGetLastUploadRetentionScanForRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetLastUploadRetentionScanForRepositoryFuncCall is an object that -// describes an invocation of method GetLastUploadRetentionScanForRepository -// on an instance of MockStore. -type StoreGetLastUploadRetentionScanForRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 *time.Time - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetLastUploadRetentionScanForRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetLastUploadRetentionScanForRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRecentAutoIndexJobsSummaryFunc describes the behavior when the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance is -// invoked. -type StoreGetRecentAutoIndexJobsSummaryFunc struct { - defaultHook func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) - hooks []func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) - history []StoreGetRecentAutoIndexJobsSummaryFuncCall - mutex sync.Mutex -} - -// GetRecentAutoIndexJobsSummary delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetRecentAutoIndexJobsSummary(v0 context.Context, v1 int) ([]shared.GroupedAutoIndexJobs, error) { - r0, r1 := m.GetRecentAutoIndexJobsSummaryFunc.nextHook()(v0, v1) - m.GetRecentAutoIndexJobsSummaryFunc.appendCall(StoreGetRecentAutoIndexJobsSummaryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRecentAutoIndexJobsSummary method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) SetDefaultReturn(r0 []shared.GroupedAutoIndexJobs, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) PushReturn(r0 []shared.GroupedAutoIndexJobs, r1 error) { - f.PushHook(func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) { - return r0, r1 - }) -} - -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) nextHook() func(context.Context, int) ([]shared.GroupedAutoIndexJobs, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) appendCall(r0 StoreGetRecentAutoIndexJobsSummaryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRecentAutoIndexJobsSummaryFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRecentAutoIndexJobsSummaryFunc) History() []StoreGetRecentAutoIndexJobsSummaryFuncCall { - f.mutex.Lock() - history := make([]StoreGetRecentAutoIndexJobsSummaryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRecentAutoIndexJobsSummaryFuncCall is an object that describes an -// invocation of method GetRecentAutoIndexJobsSummary on an instance of -// MockStore. -type StoreGetRecentAutoIndexJobsSummaryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.GroupedAutoIndexJobs - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRecentAutoIndexJobsSummaryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRecentAutoIndexJobsSummaryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRecentUploadsSummaryFunc describes the behavior when the -// GetRecentUploadsSummary method of the parent MockStore instance is -// invoked. -type StoreGetRecentUploadsSummaryFunc struct { - defaultHook func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) - hooks []func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) - history []StoreGetRecentUploadsSummaryFuncCall - mutex sync.Mutex -} - -// GetRecentUploadsSummary delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) GetRecentUploadsSummary(v0 context.Context, v1 int) ([]shared.UploadsWithRepositoryNamespace, error) { - r0, r1 := m.GetRecentUploadsSummaryFunc.nextHook()(v0, v1) - m.GetRecentUploadsSummaryFunc.appendCall(StoreGetRecentUploadsSummaryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRecentUploadsSummary method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRecentUploadsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRecentUploadsSummary method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreGetRecentUploadsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRecentUploadsSummaryFunc) SetDefaultReturn(r0 []shared.UploadsWithRepositoryNamespace, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRecentUploadsSummaryFunc) PushReturn(r0 []shared.UploadsWithRepositoryNamespace, r1 error) { - f.PushHook(func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) { - return r0, r1 - }) -} - -func (f *StoreGetRecentUploadsSummaryFunc) nextHook() func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRecentUploadsSummaryFunc) appendCall(r0 StoreGetRecentUploadsSummaryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRecentUploadsSummaryFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRecentUploadsSummaryFunc) History() []StoreGetRecentUploadsSummaryFuncCall { - f.mutex.Lock() - history := make([]StoreGetRecentUploadsSummaryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRecentUploadsSummaryFuncCall is an object that describes an -// invocation of method GetRecentUploadsSummary on an instance of MockStore. -type StoreGetRecentUploadsSummaryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.UploadsWithRepositoryNamespace - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRecentUploadsSummaryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRecentUploadsSummaryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetRepositoriesMaxStaleAgeFunc describes the behavior when the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance is -// invoked. -type StoreGetRepositoriesMaxStaleAgeFunc struct { - defaultHook func(context.Context) (time.Duration, error) - hooks []func(context.Context) (time.Duration, error) - history []StoreGetRepositoriesMaxStaleAgeFuncCall - mutex sync.Mutex -} - -// GetRepositoriesMaxStaleAge delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetRepositoriesMaxStaleAge(v0 context.Context) (time.Duration, error) { - r0, r1 := m.GetRepositoriesMaxStaleAgeFunc.nextHook()(v0) - m.GetRepositoriesMaxStaleAgeFunc.appendCall(StoreGetRepositoriesMaxStaleAgeFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) SetDefaultHook(hook func(context.Context) (time.Duration, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetRepositoriesMaxStaleAge method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) PushHook(hook func(context.Context) (time.Duration, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) SetDefaultReturn(r0 time.Duration, r1 error) { - f.SetDefaultHook(func(context.Context) (time.Duration, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) PushReturn(r0 time.Duration, r1 error) { - f.PushHook(func(context.Context) (time.Duration, error) { - return r0, r1 - }) -} - -func (f *StoreGetRepositoriesMaxStaleAgeFunc) nextHook() func(context.Context) (time.Duration, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetRepositoriesMaxStaleAgeFunc) appendCall(r0 StoreGetRepositoriesMaxStaleAgeFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetRepositoriesMaxStaleAgeFuncCall -// objects describing the invocations of this function. -func (f *StoreGetRepositoriesMaxStaleAgeFunc) History() []StoreGetRepositoriesMaxStaleAgeFuncCall { - f.mutex.Lock() - history := make([]StoreGetRepositoriesMaxStaleAgeFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetRepositoriesMaxStaleAgeFuncCall is an object that describes an -// invocation of method GetRepositoriesMaxStaleAge on an instance of -// MockStore. -type StoreGetRepositoriesMaxStaleAgeFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 time.Duration - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetRepositoriesMaxStaleAgeFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetRepositoriesMaxStaleAgeFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetUploadByIDFunc describes the behavior when the GetUploadByID -// method of the parent MockStore instance is invoked. -type StoreGetUploadByIDFunc struct { - defaultHook func(context.Context, int) (shared.Upload, bool, error) - hooks []func(context.Context, int) (shared.Upload, bool, error) - history []StoreGetUploadByIDFuncCall - mutex sync.Mutex -} - -// GetUploadByID delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetUploadByID(v0 context.Context, v1 int) (shared.Upload, bool, error) { - r0, r1, r2 := m.GetUploadByIDFunc.nextHook()(v0, v1) - m.GetUploadByIDFunc.appendCall(StoreGetUploadByIDFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetUploadByID method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (shared.Upload, bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadByID method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadByIDFunc) PushHook(hook func(context.Context, int) (shared.Upload, bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadByIDFunc) SetDefaultReturn(r0 shared.Upload, r1 bool, r2 error) { - f.SetDefaultHook(func(context.Context, int) (shared.Upload, bool, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadByIDFunc) PushReturn(r0 shared.Upload, r1 bool, r2 error) { - f.PushHook(func(context.Context, int) (shared.Upload, bool, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetUploadByIDFunc) nextHook() func(context.Context, int) (shared.Upload, bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadByIDFunc) appendCall(r0 StoreGetUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreGetUploadByIDFunc) History() []StoreGetUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadByIDFuncCall is an object that describes an invocation of -// method GetUploadByID on an instance of MockStore. -type StoreGetUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 bool - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetUploadIDsWithReferencesFunc describes the behavior when the -// GetUploadIDsWithReferences method of the parent MockStore instance is -// invoked. -type StoreGetUploadIDsWithReferencesFunc struct { - defaultHook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) - hooks []func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) - history []StoreGetUploadIDsWithReferencesFuncCall - mutex sync.Mutex -} - -// GetUploadIDsWithReferences delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadIDsWithReferences(v0 context.Context, v1 []precise.QualifiedMonikerData, v2 []int, v3 int, v4 string, v5 int, v6 int, v7 observation.TraceLogger) ([]int, int, int, error) { - r0, r1, r2, r3 := m.GetUploadIDsWithReferencesFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6, v7) - m.GetUploadIDsWithReferencesFunc.appendCall(StoreGetUploadIDsWithReferencesFuncCall{v0, v1, v2, v3, v4, v5, v6, v7, r0, r1, r2, r3}) - return r0, r1, r2, r3 -} - -// SetDefaultHook sets function that is called when the -// GetUploadIDsWithReferences method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetUploadIDsWithReferencesFunc) SetDefaultHook(hook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadIDsWithReferences method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetUploadIDsWithReferencesFunc) PushHook(hook func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadIDsWithReferencesFunc) SetDefaultReturn(r0 []int, r1 int, r2 int, r3 error) { - f.SetDefaultHook(func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - return r0, r1, r2, r3 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadIDsWithReferencesFunc) PushReturn(r0 []int, r1 int, r2 int, r3 error) { - f.PushHook(func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - return r0, r1, r2, r3 - }) -} - -func (f *StoreGetUploadIDsWithReferencesFunc) nextHook() func(context.Context, []precise.QualifiedMonikerData, []int, int, string, int, int, observation.TraceLogger) ([]int, int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadIDsWithReferencesFunc) appendCall(r0 StoreGetUploadIDsWithReferencesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadIDsWithReferencesFuncCall -// objects describing the invocations of this function. -func (f *StoreGetUploadIDsWithReferencesFunc) History() []StoreGetUploadIDsWithReferencesFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadIDsWithReferencesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadIDsWithReferencesFuncCall is an object that describes an -// invocation of method GetUploadIDsWithReferences on an instance of -// MockStore. -type StoreGetUploadIDsWithReferencesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []precise.QualifiedMonikerData - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 int - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 string - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 int - // Arg6 is the value of the 7th argument passed to this method - // invocation. - Arg6 int - // Arg7 is the value of the 8th argument passed to this method - // invocation. - Arg7 observation.TraceLogger - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 int - // Result3 is the value of the 4th result returned from this method - // invocation. - Result3 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadIDsWithReferencesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5, c.Arg6, c.Arg7} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadIDsWithReferencesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2, c.Result3} -} - -// StoreGetUploadsFunc describes the behavior when the GetUploads method of -// the parent MockStore instance is invoked. -type StoreGetUploadsFunc struct { - defaultHook func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) - hooks []func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) - history []StoreGetUploadsFuncCall - mutex sync.Mutex -} - -// GetUploads delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) GetUploads(v0 context.Context, v1 shared.GetUploadsOptions) ([]shared.Upload, int, error) { - r0, r1, r2 := m.GetUploadsFunc.nextHook()(v0, v1) - m.GetUploadsFunc.appendCall(StoreGetUploadsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the GetUploads method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploads method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadsFunc) PushHook(hook func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsFunc) SetDefaultReturn(r0 []shared.Upload, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsFunc) PushReturn(r0 []shared.Upload, r1 int, r2 error) { - f.PushHook(func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetUploadsFunc) nextHook() func(context.Context, shared.GetUploadsOptions) ([]shared.Upload, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsFunc) appendCall(r0 StoreGetUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsFuncCall objects describing -// the invocations of this function. -func (f *StoreGetUploadsFunc) History() []StoreGetUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsFuncCall is an object that describes an invocation of -// method GetUploads on an instance of MockStore. -type StoreGetUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.GetUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreGetUploadsByIDsFunc describes the behavior when the GetUploadsByIDs -// method of the parent MockStore instance is invoked. -type StoreGetUploadsByIDsFunc struct { - defaultHook func(context.Context, ...int) ([]shared.Upload, error) - hooks []func(context.Context, ...int) ([]shared.Upload, error) - history []StoreGetUploadsByIDsFuncCall - mutex sync.Mutex -} - -// GetUploadsByIDs delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadsByIDs(v0 context.Context, v1 ...int) ([]shared.Upload, error) { - r0, r1 := m.GetUploadsByIDsFunc.nextHook()(v0, v1...) - m.GetUploadsByIDsFunc.appendCall(StoreGetUploadsByIDsFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the GetUploadsByIDs -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreGetUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared.Upload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadsByIDs method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreGetUploadsByIDsFunc) PushHook(hook func(context.Context, ...int) ([]shared.Upload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsByIDsFunc) SetDefaultReturn(r0 []shared.Upload, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared.Upload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsByIDsFunc) PushReturn(r0 []shared.Upload, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared.Upload, error) { - return r0, r1 - }) -} - -func (f *StoreGetUploadsByIDsFunc) nextHook() func(context.Context, ...int) ([]shared.Upload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsByIDsFunc) appendCall(r0 StoreGetUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreGetUploadsByIDsFunc) History() []StoreGetUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsByIDsFuncCall is an object that describes an invocation of -// method GetUploadsByIDs on an instance of MockStore. -type StoreGetUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetUploadsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetUploadsByIDsAllowDeletedFunc describes the behavior when the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance is -// invoked. -type StoreGetUploadsByIDsAllowDeletedFunc struct { - defaultHook func(context.Context, ...int) ([]shared.Upload, error) - hooks []func(context.Context, ...int) ([]shared.Upload, error) - history []StoreGetUploadsByIDsAllowDeletedFuncCall - mutex sync.Mutex -} - -// GetUploadsByIDsAllowDeleted delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetUploadsByIDsAllowDeleted(v0 context.Context, v1 ...int) ([]shared.Upload, error) { - r0, r1 := m.GetUploadsByIDsAllowDeletedFunc.nextHook()(v0, v1...) - m.GetUploadsByIDsAllowDeletedFunc.appendCall(StoreGetUploadsByIDsAllowDeletedFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) SetDefaultHook(hook func(context.Context, ...int) ([]shared.Upload, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetUploadsByIDsAllowDeleted method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) PushHook(hook func(context.Context, ...int) ([]shared.Upload, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) SetDefaultReturn(r0 []shared.Upload, r1 error) { - f.SetDefaultHook(func(context.Context, ...int) ([]shared.Upload, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) PushReturn(r0 []shared.Upload, r1 error) { - f.PushHook(func(context.Context, ...int) ([]shared.Upload, error) { - return r0, r1 - }) -} - -func (f *StoreGetUploadsByIDsAllowDeletedFunc) nextHook() func(context.Context, ...int) ([]shared.Upload, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetUploadsByIDsAllowDeletedFunc) appendCall(r0 StoreGetUploadsByIDsAllowDeletedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreGetUploadsByIDsAllowDeletedFuncCall -// objects describing the invocations of this function. -func (f *StoreGetUploadsByIDsAllowDeletedFunc) History() []StoreGetUploadsByIDsAllowDeletedFuncCall { - f.mutex.Lock() - history := make([]StoreGetUploadsByIDsAllowDeletedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetUploadsByIDsAllowDeletedFuncCall is an object that describes an -// invocation of method GetUploadsByIDsAllowDeleted on an instance of -// MockStore. -type StoreGetUploadsByIDsAllowDeletedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.Upload - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreGetUploadsByIDsAllowDeletedFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetUploadsByIDsAllowDeletedFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreGetVisibleUploadsMatchingMonikersFunc describes the behavior when -// the GetVisibleUploadsMatchingMonikers method of the parent MockStore -// instance is invoked. -type StoreGetVisibleUploadsMatchingMonikersFunc struct { - defaultHook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) - hooks []func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) - history []StoreGetVisibleUploadsMatchingMonikersFuncCall - mutex sync.Mutex -} - -// GetVisibleUploadsMatchingMonikers delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) GetVisibleUploadsMatchingMonikers(v0 context.Context, v1 int, v2 string, v3 []precise.QualifiedMonikerData, v4 int, v5 int) (shared.PackageReferenceScanner, int, error) { - r0, r1, r2 := m.GetVisibleUploadsMatchingMonikersFunc.nextHook()(v0, v1, v2, v3, v4, v5) - m.GetVisibleUploadsMatchingMonikersFunc.appendCall(StoreGetVisibleUploadsMatchingMonikersFuncCall{v0, v1, v2, v3, v4, v5, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// GetVisibleUploadsMatchingMonikers method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) SetDefaultHook(hook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// GetVisibleUploadsMatchingMonikers method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) PushHook(hook func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) SetDefaultReturn(r0 shared.PackageReferenceScanner, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) PushReturn(r0 shared.PackageReferenceScanner, r1 int, r2 error) { - f.PushHook(func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) nextHook() func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) appendCall(r0 StoreGetVisibleUploadsMatchingMonikersFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreGetVisibleUploadsMatchingMonikersFuncCall objects describing the -// invocations of this function. -func (f *StoreGetVisibleUploadsMatchingMonikersFunc) History() []StoreGetVisibleUploadsMatchingMonikersFuncCall { - f.mutex.Lock() - history := make([]StoreGetVisibleUploadsMatchingMonikersFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreGetVisibleUploadsMatchingMonikersFuncCall is an object that -// describes an invocation of method GetVisibleUploadsMatchingMonikers on an -// instance of MockStore. -type StoreGetVisibleUploadsMatchingMonikersFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 []precise.QualifiedMonikerData - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 int - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared.PackageReferenceScanner - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreGetVisibleUploadsMatchingMonikersFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreGetVisibleUploadsMatchingMonikersFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreHandleFunc describes the behavior when the Handle method of the -// parent MockStore instance is invoked. -type StoreHandleFunc struct { - defaultHook func() *basestore.Store - hooks []func() *basestore.Store - history []StoreHandleFuncCall - mutex sync.Mutex -} - -// Handle delegates to the next hook function in the queue and stores the -// parameter and result values of this invocation. -func (m *MockStore) Handle() *basestore.Store { - r0 := m.HandleFunc.nextHook()() - m.HandleFunc.appendCall(StoreHandleFuncCall{r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the Handle method of the -// parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHandleFunc) SetDefaultHook(hook func() *basestore.Store) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// Handle method of the parent MockStore instance invokes the hook at the -// front of the queue and discards it. After the queue is empty, the default -// hook function is invoked for any future action. -func (f *StoreHandleFunc) PushHook(hook func() *basestore.Store) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHandleFunc) SetDefaultReturn(r0 *basestore.Store) { - f.SetDefaultHook(func() *basestore.Store { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHandleFunc) PushReturn(r0 *basestore.Store) { - f.PushHook(func() *basestore.Store { - return r0 - }) -} - -func (f *StoreHandleFunc) nextHook() func() *basestore.Store { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHandleFunc) appendCall(r0 StoreHandleFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHandleFuncCall objects describing the -// invocations of this function. -func (f *StoreHandleFunc) History() []StoreHandleFuncCall { - f.mutex.Lock() - history := make([]StoreHandleFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHandleFuncCall is an object that describes an invocation of method -// Handle on an instance of MockStore. -type StoreHandleFuncCall struct { - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 *basestore.Store -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHandleFuncCall) Args() []interface{} { - return []interface{}{} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHandleFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreHardDeleteUploadsByIDsFunc describes the behavior when the -// HardDeleteUploadsByIDs method of the parent MockStore instance is -// invoked. -type StoreHardDeleteUploadsByIDsFunc struct { - defaultHook func(context.Context, ...int) error - hooks []func(context.Context, ...int) error - history []StoreHardDeleteUploadsByIDsFuncCall - mutex sync.Mutex -} - -// HardDeleteUploadsByIDs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) HardDeleteUploadsByIDs(v0 context.Context, v1 ...int) error { - r0 := m.HardDeleteUploadsByIDsFunc.nextHook()(v0, v1...) - m.HardDeleteUploadsByIDsFunc.appendCall(StoreHardDeleteUploadsByIDsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// HardDeleteUploadsByIDs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreHardDeleteUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HardDeleteUploadsByIDs method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreHardDeleteUploadsByIDsFunc) PushHook(hook func(context.Context, ...int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHardDeleteUploadsByIDsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, ...int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHardDeleteUploadsByIDsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, ...int) error { - return r0 - }) -} - -func (f *StoreHardDeleteUploadsByIDsFunc) nextHook() func(context.Context, ...int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHardDeleteUploadsByIDsFunc) appendCall(r0 StoreHardDeleteUploadsByIDsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHardDeleteUploadsByIDsFuncCall objects -// describing the invocations of this function. -func (f *StoreHardDeleteUploadsByIDsFunc) History() []StoreHardDeleteUploadsByIDsFuncCall { - f.mutex.Lock() - history := make([]StoreHardDeleteUploadsByIDsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHardDeleteUploadsByIDsFuncCall is an object that describes an -// invocation of method HardDeleteUploadsByIDs on an instance of MockStore. -type StoreHardDeleteUploadsByIDsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is a slice containing the values of the variadic arguments - // passed to this method invocation. - Arg1 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. The variadic slice argument is flattened in this array such -// that one positional argument and three variadic arguments would result in -// a slice of four, not two. -func (c StoreHardDeleteUploadsByIDsFuncCall) Args() []interface{} { - trailing := []interface{}{} - for _, val := range c.Arg1 { - trailing = append(trailing, val) - } - - return append([]interface{}{c.Arg0}, trailing...) -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHardDeleteUploadsByIDsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreHasCommitFunc describes the behavior when the HasCommit method of -// the parent MockStore instance is invoked. -type StoreHasCommitFunc struct { - defaultHook func(context.Context, api.RepoID, api.CommitID) (bool, error) - hooks []func(context.Context, api.RepoID, api.CommitID) (bool, error) - history []StoreHasCommitFuncCall - mutex sync.Mutex -} - -// HasCommit delegates to the next hook function in the queue and stores the -// parameter and result values of this invocation. -func (m *MockStore) HasCommit(v0 context.Context, v1 api.RepoID, v2 api.CommitID) (bool, error) { - r0, r1 := m.HasCommitFunc.nextHook()(v0, v1, v2) - m.HasCommitFunc.appendCall(StoreHasCommitFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the HasCommit method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHasCommitFunc) SetDefaultHook(hook func(context.Context, api.RepoID, api.CommitID) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HasCommit method of the parent MockStore instance invokes the hook at the -// front of the queue and discards it. After the queue is empty, the default -// hook function is invoked for any future action. -func (f *StoreHasCommitFunc) PushHook(hook func(context.Context, api.RepoID, api.CommitID) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHasCommitFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, api.RepoID, api.CommitID) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHasCommitFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, api.RepoID, api.CommitID) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreHasCommitFunc) nextHook() func(context.Context, api.RepoID, api.CommitID) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHasCommitFunc) appendCall(r0 StoreHasCommitFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHasCommitFuncCall objects describing -// the invocations of this function. -func (f *StoreHasCommitFunc) History() []StoreHasCommitFuncCall { - f.mutex.Lock() - history := make([]StoreHasCommitFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHasCommitFuncCall is an object that describes an invocation of -// method HasCommit on an instance of MockStore. -type StoreHasCommitFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 api.RepoID - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 api.CommitID - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHasCommitFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHasCommitFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreHasRepositoryFunc describes the behavior when the HasRepository -// method of the parent MockStore instance is invoked. -type StoreHasRepositoryFunc struct { - defaultHook func(context.Context, api.RepoID) (bool, error) - hooks []func(context.Context, api.RepoID) (bool, error) - history []StoreHasRepositoryFuncCall - mutex sync.Mutex -} - -// HasRepository delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) HasRepository(v0 context.Context, v1 api.RepoID) (bool, error) { - r0, r1 := m.HasRepositoryFunc.nextHook()(v0, v1) - m.HasRepositoryFunc.appendCall(StoreHasRepositoryFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the HasRepository method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreHasRepositoryFunc) SetDefaultHook(hook func(context.Context, api.RepoID) (bool, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// HasRepository method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreHasRepositoryFunc) PushHook(hook func(context.Context, api.RepoID) (bool, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreHasRepositoryFunc) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, api.RepoID) (bool, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreHasRepositoryFunc) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, api.RepoID) (bool, error) { - return r0, r1 - }) -} - -func (f *StoreHasRepositoryFunc) nextHook() func(context.Context, api.RepoID) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreHasRepositoryFunc) appendCall(r0 StoreHasRepositoryFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreHasRepositoryFuncCall objects -// describing the invocations of this function. -func (f *StoreHasRepositoryFunc) History() []StoreHasRepositoryFuncCall { - f.mutex.Lock() - history := make([]StoreHasRepositoryFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreHasRepositoryFuncCall is an object that describes an invocation of -// method HasRepository on an instance of MockStore. -type StoreHasRepositoryFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 api.RepoID - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 bool - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreHasRepositoryFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreHasRepositoryFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreInsertDependencySyncingJobFunc describes the behavior when the -// InsertDependencySyncingJob method of the parent MockStore instance is -// invoked. -type StoreInsertDependencySyncingJobFunc struct { - defaultHook func(context.Context, int) (int, error) - hooks []func(context.Context, int) (int, error) - history []StoreInsertDependencySyncingJobFuncCall - mutex sync.Mutex -} - -// InsertDependencySyncingJob delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) InsertDependencySyncingJob(v0 context.Context, v1 int) (int, error) { - r0, r1 := m.InsertDependencySyncingJobFunc.nextHook()(v0, v1) - m.InsertDependencySyncingJobFunc.appendCall(StoreInsertDependencySyncingJobFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// InsertDependencySyncingJob method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreInsertDependencySyncingJobFunc) SetDefaultHook(hook func(context.Context, int) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// InsertDependencySyncingJob method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreInsertDependencySyncingJobFunc) PushHook(hook func(context.Context, int) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreInsertDependencySyncingJobFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, int) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreInsertDependencySyncingJobFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, int) (int, error) { - return r0, r1 - }) -} - -func (f *StoreInsertDependencySyncingJobFunc) nextHook() func(context.Context, int) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreInsertDependencySyncingJobFunc) appendCall(r0 StoreInsertDependencySyncingJobFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreInsertDependencySyncingJobFuncCall -// objects describing the invocations of this function. -func (f *StoreInsertDependencySyncingJobFunc) History() []StoreInsertDependencySyncingJobFuncCall { - f.mutex.Lock() - history := make([]StoreInsertDependencySyncingJobFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreInsertDependencySyncingJobFuncCall is an object that describes an -// invocation of method InsertDependencySyncingJob on an instance of -// MockStore. -type StoreInsertDependencySyncingJobFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreInsertDependencySyncingJobFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreInsertDependencySyncingJobFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreInsertUploadFunc describes the behavior when the InsertUpload method -// of the parent MockStore instance is invoked. -type StoreInsertUploadFunc struct { - defaultHook func(context.Context, shared.Upload) (int, error) - hooks []func(context.Context, shared.Upload) (int, error) - history []StoreInsertUploadFuncCall - mutex sync.Mutex -} - -// InsertUpload delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) InsertUpload(v0 context.Context, v1 shared.Upload) (int, error) { - r0, r1 := m.InsertUploadFunc.nextHook()(v0, v1) - m.InsertUploadFunc.appendCall(StoreInsertUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the InsertUpload method -// of the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreInsertUploadFunc) SetDefaultHook(hook func(context.Context, shared.Upload) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// InsertUpload method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreInsertUploadFunc) PushHook(hook func(context.Context, shared.Upload) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreInsertUploadFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, shared.Upload) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreInsertUploadFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, shared.Upload) (int, error) { - return r0, r1 - }) -} - -func (f *StoreInsertUploadFunc) nextHook() func(context.Context, shared.Upload) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreInsertUploadFunc) appendCall(r0 StoreInsertUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreInsertUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreInsertUploadFunc) History() []StoreInsertUploadFuncCall { - f.mutex.Lock() - history := make([]StoreInsertUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreInsertUploadFuncCall is an object that describes an invocation of -// method InsertUpload on an instance of MockStore. -type StoreInsertUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.Upload - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreInsertUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreInsertUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreMarkFailedFunc describes the behavior when the MarkFailed method of -// the parent MockStore instance is invoked. -type StoreMarkFailedFunc struct { - defaultHook func(context.Context, int, string) error - hooks []func(context.Context, int, string) error - history []StoreMarkFailedFuncCall - mutex sync.Mutex -} - -// MarkFailed delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) MarkFailed(v0 context.Context, v1 int, v2 string) error { - r0 := m.MarkFailedFunc.nextHook()(v0, v1, v2) - m.MarkFailedFunc.appendCall(StoreMarkFailedFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the MarkFailed method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreMarkFailedFunc) SetDefaultHook(hook func(context.Context, int, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// MarkFailed method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreMarkFailedFunc) PushHook(hook func(context.Context, int, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreMarkFailedFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreMarkFailedFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string) error { - return r0 - }) -} - -func (f *StoreMarkFailedFunc) nextHook() func(context.Context, int, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreMarkFailedFunc) appendCall(r0 StoreMarkFailedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreMarkFailedFuncCall objects describing -// the invocations of this function. -func (f *StoreMarkFailedFunc) History() []StoreMarkFailedFuncCall { - f.mutex.Lock() - history := make([]StoreMarkFailedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreMarkFailedFuncCall is an object that describes an invocation of -// method MarkFailed on an instance of MockStore. -type StoreMarkFailedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreMarkFailedFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreMarkFailedFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreMarkQueuedFunc describes the behavior when the MarkQueued method of -// the parent MockStore instance is invoked. -type StoreMarkQueuedFunc struct { - defaultHook func(context.Context, int, *int64) error - hooks []func(context.Context, int, *int64) error - history []StoreMarkQueuedFuncCall - mutex sync.Mutex -} - -// MarkQueued delegates to the next hook function in the queue and stores -// the parameter and result values of this invocation. -func (m *MockStore) MarkQueued(v0 context.Context, v1 int, v2 *int64) error { - r0 := m.MarkQueuedFunc.nextHook()(v0, v1, v2) - m.MarkQueuedFunc.appendCall(StoreMarkQueuedFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the MarkQueued method of -// the parent MockStore instance is invoked and the hook queue is empty. -func (f *StoreMarkQueuedFunc) SetDefaultHook(hook func(context.Context, int, *int64) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// MarkQueued method of the parent MockStore instance invokes the hook at -// the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreMarkQueuedFunc) PushHook(hook func(context.Context, int, *int64) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreMarkQueuedFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, *int64) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreMarkQueuedFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, *int64) error { - return r0 - }) -} - -func (f *StoreMarkQueuedFunc) nextHook() func(context.Context, int, *int64) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreMarkQueuedFunc) appendCall(r0 StoreMarkQueuedFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreMarkQueuedFuncCall objects describing -// the invocations of this function. -func (f *StoreMarkQueuedFunc) History() []StoreMarkQueuedFuncCall { - f.mutex.Lock() - history := make([]StoreMarkQueuedFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreMarkQueuedFuncCall is an object that describes an invocation of -// method MarkQueued on an instance of MockStore. -type StoreMarkQueuedFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *int64 - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreMarkQueuedFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreMarkQueuedFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreNumRepositoriesWithCodeIntelligenceFunc describes the behavior when -// the NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance is invoked. -type StoreNumRepositoriesWithCodeIntelligenceFunc struct { - defaultHook func(context.Context) (int, error) - hooks []func(context.Context) (int, error) - history []StoreNumRepositoriesWithCodeIntelligenceFuncCall - mutex sync.Mutex -} - -// NumRepositoriesWithCodeIntelligence delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) NumRepositoriesWithCodeIntelligence(v0 context.Context) (int, error) { - r0, r1 := m.NumRepositoriesWithCodeIntelligenceFunc.nextHook()(v0) - m.NumRepositoriesWithCodeIntelligenceFunc.appendCall(StoreNumRepositoriesWithCodeIntelligenceFuncCall{v0, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) SetDefaultHook(hook func(context.Context) (int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// NumRepositoriesWithCodeIntelligence method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) PushHook(hook func(context.Context) (int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context) (int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context) (int, error) { - return r0, r1 - }) -} - -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) nextHook() func(context.Context) (int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) appendCall(r0 StoreNumRepositoriesWithCodeIntelligenceFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreNumRepositoriesWithCodeIntelligenceFuncCall objects describing the -// invocations of this function. -func (f *StoreNumRepositoriesWithCodeIntelligenceFunc) History() []StoreNumRepositoriesWithCodeIntelligenceFuncCall { - f.mutex.Lock() - history := make([]StoreNumRepositoriesWithCodeIntelligenceFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreNumRepositoriesWithCodeIntelligenceFuncCall is an object that -// describes an invocation of method NumRepositoriesWithCodeIntelligence on -// an instance of MockStore. -type StoreNumRepositoriesWithCodeIntelligenceFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreNumRepositoriesWithCodeIntelligenceFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreNumRepositoriesWithCodeIntelligenceFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreProcessSourcedCommitsFunc describes the behavior when the -// ProcessSourcedCommits method of the parent MockStore instance is invoked. -type StoreProcessSourcedCommitsFunc struct { - defaultHook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) - hooks []func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) - history []StoreProcessSourcedCommitsFuncCall - mutex sync.Mutex -} - -// ProcessSourcedCommits delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) ProcessSourcedCommits(v0 context.Context, v1 time.Duration, v2 time.Duration, v3 int, v4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), v5 time.Time) (int, int, error) { - r0, r1, r2 := m.ProcessSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4, v5) - m.ProcessSourcedCommitsFunc.appendCall(StoreProcessSourcedCommitsFuncCall{v0, v1, v2, v3, v4, v5, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// ProcessSourcedCommits method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreProcessSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ProcessSourcedCommits method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreProcessSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreProcessSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreProcessSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreProcessSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, time.Duration, int, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error), time.Time) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreProcessSourcedCommitsFunc) appendCall(r0 StoreProcessSourcedCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreProcessSourcedCommitsFuncCall objects -// describing the invocations of this function. -func (f *StoreProcessSourcedCommitsFunc) History() []StoreProcessSourcedCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreProcessSourcedCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreProcessSourcedCommitsFuncCall is an object that describes an -// invocation of method ProcessSourcedCommits on an instance of MockStore. -type StoreProcessSourcedCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 time.Duration - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 int - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error) - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreProcessSourcedCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreProcessSourcedCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreProcessStaleSourcedCommitsFunc describes the behavior when the -// ProcessStaleSourcedCommits method of the parent MockStore instance is -// invoked. -type StoreProcessStaleSourcedCommitsFunc struct { - defaultHook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) - hooks []func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) - history []StoreProcessStaleSourcedCommitsFuncCall - mutex sync.Mutex -} - -// ProcessStaleSourcedCommits delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) ProcessStaleSourcedCommits(v0 context.Context, v1 time.Duration, v2 int, v3 time.Duration, v4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - r0, r1, r2 := m.ProcessStaleSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4) - m.ProcessStaleSourcedCommitsFunc.appendCall(StoreProcessStaleSourcedCommitsFuncCall{v0, v1, v2, v3, v4, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// ProcessStaleSourcedCommits method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreProcessStaleSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ProcessStaleSourcedCommits method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreProcessStaleSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreProcessStaleSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreProcessStaleSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreProcessStaleSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, int, time.Duration, func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error)) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreProcessStaleSourcedCommitsFunc) appendCall(r0 StoreProcessStaleSourcedCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreProcessStaleSourcedCommitsFuncCall -// objects describing the invocations of this function. -func (f *StoreProcessStaleSourcedCommitsFunc) History() []StoreProcessStaleSourcedCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreProcessStaleSourcedCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreProcessStaleSourcedCommitsFuncCall is an object that describes an -// invocation of method ProcessStaleSourcedCommits on an instance of -// MockStore. -type StoreProcessStaleSourcedCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 time.Duration - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 func(ctx context.Context, repositoryID int, repositoryName string, commit string) (bool, error) - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreProcessStaleSourcedCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreProcessStaleSourcedCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreReconcileCandidatesFunc describes the behavior when the -// ReconcileCandidates method of the parent MockStore instance is invoked. -type StoreReconcileCandidatesFunc struct { - defaultHook func(context.Context, int) ([]int, error) - hooks []func(context.Context, int) ([]int, error) - history []StoreReconcileCandidatesFuncCall - mutex sync.Mutex -} - -// ReconcileCandidates delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReconcileCandidates(v0 context.Context, v1 int) ([]int, error) { - r0, r1 := m.ReconcileCandidatesFunc.nextHook()(v0, v1) - m.ReconcileCandidatesFunc.appendCall(StoreReconcileCandidatesFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the ReconcileCandidates -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReconcileCandidatesFunc) SetDefaultHook(hook func(context.Context, int) ([]int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReconcileCandidates method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReconcileCandidatesFunc) PushHook(hook func(context.Context, int) ([]int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReconcileCandidatesFunc) SetDefaultReturn(r0 []int, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReconcileCandidatesFunc) PushReturn(r0 []int, r1 error) { - f.PushHook(func(context.Context, int) ([]int, error) { - return r0, r1 - }) -} - -func (f *StoreReconcileCandidatesFunc) nextHook() func(context.Context, int) ([]int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReconcileCandidatesFunc) appendCall(r0 StoreReconcileCandidatesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReconcileCandidatesFuncCall objects -// describing the invocations of this function. -func (f *StoreReconcileCandidatesFunc) History() []StoreReconcileCandidatesFuncCall { - f.mutex.Lock() - history := make([]StoreReconcileCandidatesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReconcileCandidatesFuncCall is an object that describes an -// invocation of method ReconcileCandidates on an instance of MockStore. -type StoreReconcileCandidatesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReconcileCandidatesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReconcileCandidatesFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreReferencesForUploadFunc describes the behavior when the -// ReferencesForUpload method of the parent MockStore instance is invoked. -type StoreReferencesForUploadFunc struct { - defaultHook func(context.Context, int) (shared.PackageReferenceScanner, error) - hooks []func(context.Context, int) (shared.PackageReferenceScanner, error) - history []StoreReferencesForUploadFuncCall - mutex sync.Mutex -} - -// ReferencesForUpload delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReferencesForUpload(v0 context.Context, v1 int) (shared.PackageReferenceScanner, error) { - r0, r1 := m.ReferencesForUploadFunc.nextHook()(v0, v1) - m.ReferencesForUploadFunc.appendCall(StoreReferencesForUploadFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the ReferencesForUpload -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReferencesForUploadFunc) SetDefaultHook(hook func(context.Context, int) (shared.PackageReferenceScanner, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReferencesForUpload method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReferencesForUploadFunc) PushHook(hook func(context.Context, int) (shared.PackageReferenceScanner, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReferencesForUploadFunc) SetDefaultReturn(r0 shared.PackageReferenceScanner, r1 error) { - f.SetDefaultHook(func(context.Context, int) (shared.PackageReferenceScanner, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReferencesForUploadFunc) PushReturn(r0 shared.PackageReferenceScanner, r1 error) { - f.PushHook(func(context.Context, int) (shared.PackageReferenceScanner, error) { - return r0, r1 - }) -} - -func (f *StoreReferencesForUploadFunc) nextHook() func(context.Context, int) (shared.PackageReferenceScanner, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReferencesForUploadFunc) appendCall(r0 StoreReferencesForUploadFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReferencesForUploadFuncCall objects -// describing the invocations of this function. -func (f *StoreReferencesForUploadFunc) History() []StoreReferencesForUploadFuncCall { - f.mutex.Lock() - history := make([]StoreReferencesForUploadFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReferencesForUploadFuncCall is an object that describes an -// invocation of method ReferencesForUpload on an instance of MockStore. -type StoreReferencesForUploadFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 shared.PackageReferenceScanner - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReferencesForUploadFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReferencesForUploadFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreReindexUploadByIDFunc describes the behavior when the -// ReindexUploadByID method of the parent MockStore instance is invoked. -type StoreReindexUploadByIDFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreReindexUploadByIDFuncCall - mutex sync.Mutex -} - -// ReindexUploadByID delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReindexUploadByID(v0 context.Context, v1 int) error { - r0 := m.ReindexUploadByIDFunc.nextHook()(v0, v1) - m.ReindexUploadByIDFunc.appendCall(StoreReindexUploadByIDFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the ReindexUploadByID -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReindexUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReindexUploadByID method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreReindexUploadByIDFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReindexUploadByIDFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReindexUploadByIDFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreReindexUploadByIDFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReindexUploadByIDFunc) appendCall(r0 StoreReindexUploadByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReindexUploadByIDFuncCall objects -// describing the invocations of this function. -func (f *StoreReindexUploadByIDFunc) History() []StoreReindexUploadByIDFuncCall { - f.mutex.Lock() - history := make([]StoreReindexUploadByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReindexUploadByIDFuncCall is an object that describes an invocation -// of method ReindexUploadByID on an instance of MockStore. -type StoreReindexUploadByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReindexUploadByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReindexUploadByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreReindexUploadsFunc describes the behavior when the ReindexUploads -// method of the parent MockStore instance is invoked. -type StoreReindexUploadsFunc struct { - defaultHook func(context.Context, shared.ReindexUploadsOptions) error - hooks []func(context.Context, shared.ReindexUploadsOptions) error - history []StoreReindexUploadsFuncCall - mutex sync.Mutex -} - -// ReindexUploads delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) ReindexUploads(v0 context.Context, v1 shared.ReindexUploadsOptions) error { - r0 := m.ReindexUploadsFunc.nextHook()(v0, v1) - m.ReindexUploadsFunc.appendCall(StoreReindexUploadsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the ReindexUploads -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreReindexUploadsFunc) SetDefaultHook(hook func(context.Context, shared.ReindexUploadsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// ReindexUploads method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreReindexUploadsFunc) PushHook(hook func(context.Context, shared.ReindexUploadsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreReindexUploadsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared.ReindexUploadsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreReindexUploadsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared.ReindexUploadsOptions) error { - return r0 - }) -} - -func (f *StoreReindexUploadsFunc) nextHook() func(context.Context, shared.ReindexUploadsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreReindexUploadsFunc) appendCall(r0 StoreReindexUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreReindexUploadsFuncCall objects -// describing the invocations of this function. -func (f *StoreReindexUploadsFunc) History() []StoreReindexUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreReindexUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreReindexUploadsFuncCall is an object that describes an invocation of -// method ReindexUploads on an instance of MockStore. -type StoreReindexUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.ReindexUploadsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreReindexUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreReindexUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreRepositoryIDsWithErrorsFunc describes the behavior when the -// RepositoryIDsWithErrors method of the parent MockStore instance is -// invoked. -type StoreRepositoryIDsWithErrorsFunc struct { - defaultHook func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) - hooks []func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) - history []StoreRepositoryIDsWithErrorsFuncCall - mutex sync.Mutex -} - -// RepositoryIDsWithErrors delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) RepositoryIDsWithErrors(v0 context.Context, v1 int, v2 int) ([]shared.RepositoryWithCount, int, error) { - r0, r1, r2 := m.RepositoryIDsWithErrorsFunc.nextHook()(v0, v1, v2) - m.RepositoryIDsWithErrorsFunc.appendCall(StoreRepositoryIDsWithErrorsFuncCall{v0, v1, v2, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// RepositoryIDsWithErrors method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreRepositoryIDsWithErrorsFunc) SetDefaultHook(hook func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// RepositoryIDsWithErrors method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreRepositoryIDsWithErrorsFunc) PushHook(hook func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreRepositoryIDsWithErrorsFunc) SetDefaultReturn(r0 []shared.RepositoryWithCount, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreRepositoryIDsWithErrorsFunc) PushReturn(r0 []shared.RepositoryWithCount, r1 int, r2 error) { - f.PushHook(func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreRepositoryIDsWithErrorsFunc) nextHook() func(context.Context, int, int) ([]shared.RepositoryWithCount, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreRepositoryIDsWithErrorsFunc) appendCall(r0 StoreRepositoryIDsWithErrorsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreRepositoryIDsWithErrorsFuncCall -// objects describing the invocations of this function. -func (f *StoreRepositoryIDsWithErrorsFunc) History() []StoreRepositoryIDsWithErrorsFuncCall { - f.mutex.Lock() - history := make([]StoreRepositoryIDsWithErrorsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreRepositoryIDsWithErrorsFuncCall is an object that describes an -// invocation of method RepositoryIDsWithErrors on an instance of MockStore. -type StoreRepositoryIDsWithErrorsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []shared.RepositoryWithCount - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreRepositoryIDsWithErrorsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreRepositoryIDsWithErrorsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSetRepositoriesForRetentionScanFunc describes the behavior when the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// is invoked. -type StoreSetRepositoriesForRetentionScanFunc struct { - defaultHook func(context.Context, time.Duration, int) ([]int, error) - hooks []func(context.Context, time.Duration, int) ([]int, error) - history []StoreSetRepositoriesForRetentionScanFuncCall - mutex sync.Mutex -} - -// SetRepositoriesForRetentionScan delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) SetRepositoriesForRetentionScan(v0 context.Context, v1 time.Duration, v2 int) ([]int, error) { - r0, r1 := m.SetRepositoriesForRetentionScanFunc.nextHook()(v0, v1, v2) - m.SetRepositoriesForRetentionScanFunc.appendCall(StoreSetRepositoriesForRetentionScanFuncCall{v0, v1, v2, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreSetRepositoriesForRetentionScanFunc) SetDefaultHook(hook func(context.Context, time.Duration, int) ([]int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRepositoriesForRetentionScan method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreSetRepositoriesForRetentionScanFunc) PushHook(hook func(context.Context, time.Duration, int) ([]int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRepositoriesForRetentionScanFunc) SetDefaultReturn(r0 []int, r1 error) { - f.SetDefaultHook(func(context.Context, time.Duration, int) ([]int, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRepositoriesForRetentionScanFunc) PushReturn(r0 []int, r1 error) { - f.PushHook(func(context.Context, time.Duration, int) ([]int, error) { - return r0, r1 - }) -} - -func (f *StoreSetRepositoriesForRetentionScanFunc) nextHook() func(context.Context, time.Duration, int) ([]int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRepositoriesForRetentionScanFunc) appendCall(r0 StoreSetRepositoriesForRetentionScanFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSetRepositoriesForRetentionScanFuncCall objects describing the -// invocations of this function. -func (f *StoreSetRepositoriesForRetentionScanFunc) History() []StoreSetRepositoriesForRetentionScanFuncCall { - f.mutex.Lock() - history := make([]StoreSetRepositoriesForRetentionScanFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRepositoriesForRetentionScanFuncCall is an object that describes -// an invocation of method SetRepositoriesForRetentionScan on an instance of -// MockStore. -type StoreSetRepositoriesForRetentionScanFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 time.Duration - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRepositoriesForRetentionScanFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRepositoriesForRetentionScanFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreSetRepositoryAsDirtyFunc describes the behavior when the -// SetRepositoryAsDirty method of the parent MockStore instance is invoked. -type StoreSetRepositoryAsDirtyFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreSetRepositoryAsDirtyFuncCall - mutex sync.Mutex -} - -// SetRepositoryAsDirty delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) SetRepositoryAsDirty(v0 context.Context, v1 int) error { - r0 := m.SetRepositoryAsDirtyFunc.nextHook()(v0, v1) - m.SetRepositoryAsDirtyFunc.appendCall(StoreSetRepositoryAsDirtyFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the SetRepositoryAsDirty -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreSetRepositoryAsDirtyFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRepositoryAsDirty method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreSetRepositoryAsDirtyFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRepositoryAsDirtyFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRepositoryAsDirtyFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreSetRepositoryAsDirtyFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRepositoryAsDirtyFunc) appendCall(r0 StoreSetRepositoryAsDirtyFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRepositoryAsDirtyFuncCall objects -// describing the invocations of this function. -func (f *StoreSetRepositoryAsDirtyFunc) History() []StoreSetRepositoryAsDirtyFuncCall { - f.mutex.Lock() - history := make([]StoreSetRepositoryAsDirtyFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRepositoryAsDirtyFuncCall is an object that describes an -// invocation of method SetRepositoryAsDirty on an instance of MockStore. -type StoreSetRepositoryAsDirtyFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRepositoryAsDirtyFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRepositoryAsDirtyFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSetRerunAutoIndexJobByIDFunc describes the behavior when the -// SetRerunAutoIndexJobByID method of the parent MockStore instance is -// invoked. -type StoreSetRerunAutoIndexJobByIDFunc struct { - defaultHook func(context.Context, int) error - hooks []func(context.Context, int) error - history []StoreSetRerunAutoIndexJobByIDFuncCall - mutex sync.Mutex -} - -// SetRerunAutoIndexJobByID delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SetRerunAutoIndexJobByID(v0 context.Context, v1 int) error { - r0 := m.SetRerunAutoIndexJobByIDFunc.nextHook()(v0, v1) - m.SetRerunAutoIndexJobByIDFunc.appendCall(StoreSetRerunAutoIndexJobByIDFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// SetRerunAutoIndexJobByID method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreSetRerunAutoIndexJobByIDFunc) SetDefaultHook(hook func(context.Context, int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRerunAutoIndexJobByID method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreSetRerunAutoIndexJobByIDFunc) PushHook(hook func(context.Context, int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRerunAutoIndexJobByIDFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRerunAutoIndexJobByIDFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int) error { - return r0 - }) -} - -func (f *StoreSetRerunAutoIndexJobByIDFunc) nextHook() func(context.Context, int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRerunAutoIndexJobByIDFunc) appendCall(r0 StoreSetRerunAutoIndexJobByIDFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRerunAutoIndexJobByIDFuncCall -// objects describing the invocations of this function. -func (f *StoreSetRerunAutoIndexJobByIDFunc) History() []StoreSetRerunAutoIndexJobByIDFuncCall { - f.mutex.Lock() - history := make([]StoreSetRerunAutoIndexJobByIDFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRerunAutoIndexJobByIDFuncCall is an object that describes an -// invocation of method SetRerunAutoIndexJobByID on an instance of -// MockStore. -type StoreSetRerunAutoIndexJobByIDFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRerunAutoIndexJobByIDFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRerunAutoIndexJobByIDFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSetRerunAutoIndexJobsFunc describes the behavior when the -// SetRerunAutoIndexJobs method of the parent MockStore instance is invoked. -type StoreSetRerunAutoIndexJobsFunc struct { - defaultHook func(context.Context, shared.SetRerunAutoIndexJobsOptions) error - hooks []func(context.Context, shared.SetRerunAutoIndexJobsOptions) error - history []StoreSetRerunAutoIndexJobsFuncCall - mutex sync.Mutex -} - -// SetRerunAutoIndexJobs delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SetRerunAutoIndexJobs(v0 context.Context, v1 shared.SetRerunAutoIndexJobsOptions) error { - r0 := m.SetRerunAutoIndexJobsFunc.nextHook()(v0, v1) - m.SetRerunAutoIndexJobsFunc.appendCall(StoreSetRerunAutoIndexJobsFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// SetRerunAutoIndexJobs method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreSetRerunAutoIndexJobsFunc) SetDefaultHook(hook func(context.Context, shared.SetRerunAutoIndexJobsOptions) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SetRerunAutoIndexJobs method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreSetRerunAutoIndexJobsFunc) PushHook(hook func(context.Context, shared.SetRerunAutoIndexJobsOptions) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSetRerunAutoIndexJobsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, shared.SetRerunAutoIndexJobsOptions) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSetRerunAutoIndexJobsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, shared.SetRerunAutoIndexJobsOptions) error { - return r0 - }) -} - -func (f *StoreSetRerunAutoIndexJobsFunc) nextHook() func(context.Context, shared.SetRerunAutoIndexJobsOptions) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSetRerunAutoIndexJobsFunc) appendCall(r0 StoreSetRerunAutoIndexJobsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSetRerunAutoIndexJobsFuncCall objects -// describing the invocations of this function. -func (f *StoreSetRerunAutoIndexJobsFunc) History() []StoreSetRerunAutoIndexJobsFuncCall { - f.mutex.Lock() - history := make([]StoreSetRerunAutoIndexJobsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSetRerunAutoIndexJobsFuncCall is an object that describes an -// invocation of method SetRerunAutoIndexJobs on an instance of MockStore. -type StoreSetRerunAutoIndexJobsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 shared.SetRerunAutoIndexJobsOptions - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSetRerunAutoIndexJobsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSetRerunAutoIndexJobsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreSoftDeleteExpiredUploadsFunc describes the behavior when the -// SoftDeleteExpiredUploads method of the parent MockStore instance is -// invoked. -type StoreSoftDeleteExpiredUploadsFunc struct { - defaultHook func(context.Context, int) (int, int, error) - hooks []func(context.Context, int) (int, int, error) - history []StoreSoftDeleteExpiredUploadsFuncCall - mutex sync.Mutex -} - -// SoftDeleteExpiredUploads delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) SoftDeleteExpiredUploads(v0 context.Context, v1 int) (int, int, error) { - r0, r1, r2 := m.SoftDeleteExpiredUploadsFunc.nextHook()(v0, v1) - m.SoftDeleteExpiredUploadsFunc.appendCall(StoreSoftDeleteExpiredUploadsFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// SoftDeleteExpiredUploads method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreSoftDeleteExpiredUploadsFunc) SetDefaultHook(hook func(context.Context, int) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SoftDeleteExpiredUploads method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreSoftDeleteExpiredUploadsFunc) PushHook(hook func(context.Context, int) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSoftDeleteExpiredUploadsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSoftDeleteExpiredUploadsFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreSoftDeleteExpiredUploadsFunc) nextHook() func(context.Context, int) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSoftDeleteExpiredUploadsFunc) appendCall(r0 StoreSoftDeleteExpiredUploadsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreSoftDeleteExpiredUploadsFuncCall -// objects describing the invocations of this function. -func (f *StoreSoftDeleteExpiredUploadsFunc) History() []StoreSoftDeleteExpiredUploadsFuncCall { - f.mutex.Lock() - history := make([]StoreSoftDeleteExpiredUploadsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSoftDeleteExpiredUploadsFuncCall is an object that describes an -// invocation of method SoftDeleteExpiredUploads on an instance of -// MockStore. -type StoreSoftDeleteExpiredUploadsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSoftDeleteExpiredUploadsViaTraversalFunc describes the behavior when -// the SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance is invoked. -type StoreSoftDeleteExpiredUploadsViaTraversalFunc struct { - defaultHook func(context.Context, int) (int, int, error) - hooks []func(context.Context, int) (int, int, error) - history []StoreSoftDeleteExpiredUploadsViaTraversalFuncCall - mutex sync.Mutex -} - -// SoftDeleteExpiredUploadsViaTraversal delegates to the next hook function -// in the queue and stores the parameter and result values of this -// invocation. -func (m *MockStore) SoftDeleteExpiredUploadsViaTraversal(v0 context.Context, v1 int) (int, int, error) { - r0, r1, r2 := m.SoftDeleteExpiredUploadsViaTraversalFunc.nextHook()(v0, v1) - m.SoftDeleteExpiredUploadsViaTraversalFunc.appendCall(StoreSoftDeleteExpiredUploadsViaTraversalFuncCall{v0, v1, r0, r1, r2}) - return r0, r1, r2 -} - -// SetDefaultHook sets function that is called when the -// SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance is invoked and the hook queue is empty. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) SetDefaultHook(hook func(context.Context, int) (int, int, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SoftDeleteExpiredUploadsViaTraversal method of the parent MockStore -// instance invokes the hook at the front of the queue and discards it. -// After the queue is empty, the default hook function is invoked for any -// future action. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) PushHook(hook func(context.Context, int) (int, int, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) SetDefaultReturn(r0 int, r1 int, r2 error) { - f.SetDefaultHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) PushReturn(r0 int, r1 int, r2 error) { - f.PushHook(func(context.Context, int) (int, int, error) { - return r0, r1, r2 - }) -} - -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) nextHook() func(context.Context, int) (int, int, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) appendCall(r0 StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSoftDeleteExpiredUploadsViaTraversalFuncCall objects describing the -// invocations of this function. -func (f *StoreSoftDeleteExpiredUploadsViaTraversalFunc) History() []StoreSoftDeleteExpiredUploadsViaTraversalFuncCall { - f.mutex.Lock() - history := make([]StoreSoftDeleteExpiredUploadsViaTraversalFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSoftDeleteExpiredUploadsViaTraversalFuncCall is an object that -// describes an invocation of method SoftDeleteExpiredUploadsViaTraversal on -// an instance of MockStore. -type StoreSoftDeleteExpiredUploadsViaTraversalFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 int - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 int - // Result2 is the value of the 3rd result returned from this method - // invocation. - Result2 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSoftDeleteExpiredUploadsViaTraversalFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1, c.Result2} -} - -// StoreSourcedCommitsWithoutCommittedAtFunc describes the behavior when the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// is invoked. -type StoreSourcedCommitsWithoutCommittedAtFunc struct { - defaultHook func(context.Context, int) ([]store.SourcedCommits, error) - hooks []func(context.Context, int) ([]store.SourcedCommits, error) - history []StoreSourcedCommitsWithoutCommittedAtFuncCall - mutex sync.Mutex -} - -// SourcedCommitsWithoutCommittedAt delegates to the next hook function in -// the queue and stores the parameter and result values of this invocation. -func (m *MockStore) SourcedCommitsWithoutCommittedAt(v0 context.Context, v1 int) ([]store.SourcedCommits, error) { - r0, r1 := m.SourcedCommitsWithoutCommittedAtFunc.nextHook()(v0, v1) - m.SourcedCommitsWithoutCommittedAtFunc.appendCall(StoreSourcedCommitsWithoutCommittedAtFuncCall{v0, v1, r0, r1}) - return r0, r1 -} - -// SetDefaultHook sets function that is called when the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// is invoked and the hook queue is empty. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) SetDefaultHook(hook func(context.Context, int) ([]store.SourcedCommits, error)) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) PushHook(hook func(context.Context, int) ([]store.SourcedCommits, error)) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) SetDefaultReturn(r0 []store.SourcedCommits, r1 error) { - f.SetDefaultHook(func(context.Context, int) ([]store.SourcedCommits, error) { - return r0, r1 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) PushReturn(r0 []store.SourcedCommits, r1 error) { - f.PushHook(func(context.Context, int) ([]store.SourcedCommits, error) { - return r0, r1 - }) -} - -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) nextHook() func(context.Context, int) ([]store.SourcedCommits, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) appendCall(r0 StoreSourcedCommitsWithoutCommittedAtFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of -// StoreSourcedCommitsWithoutCommittedAtFuncCall objects describing the -// invocations of this function. -func (f *StoreSourcedCommitsWithoutCommittedAtFunc) History() []StoreSourcedCommitsWithoutCommittedAtFuncCall { - f.mutex.Lock() - history := make([]StoreSourcedCommitsWithoutCommittedAtFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreSourcedCommitsWithoutCommittedAtFuncCall is an object that describes -// an invocation of method SourcedCommitsWithoutCommittedAt on an instance -// of MockStore. -type StoreSourcedCommitsWithoutCommittedAtFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 []store.SourcedCommits - // Result1 is the value of the 2nd result returned from this method - // invocation. - Result1 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreSourcedCommitsWithoutCommittedAtFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreSourcedCommitsWithoutCommittedAtFuncCall) Results() []interface{} { - return []interface{}{c.Result0, c.Result1} -} - -// StoreUpdateCommittedAtFunc describes the behavior when the -// UpdateCommittedAt method of the parent MockStore instance is invoked. -type StoreUpdateCommittedAtFunc struct { - defaultHook func(context.Context, int, string, string) error - hooks []func(context.Context, int, string, string) error - history []StoreUpdateCommittedAtFuncCall - mutex sync.Mutex -} - -// UpdateCommittedAt delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) UpdateCommittedAt(v0 context.Context, v1 int, v2 string, v3 string) error { - r0 := m.UpdateCommittedAtFunc.nextHook()(v0, v1, v2, v3) - m.UpdateCommittedAtFunc.appendCall(StoreUpdateCommittedAtFuncCall{v0, v1, v2, v3, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the UpdateCommittedAt -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreUpdateCommittedAtFunc) SetDefaultHook(hook func(context.Context, int, string, string) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateCommittedAt method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreUpdateCommittedAtFunc) PushHook(hook func(context.Context, int, string, string) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateCommittedAtFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, string, string) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateCommittedAtFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, string, string) error { - return r0 - }) -} - -func (f *StoreUpdateCommittedAtFunc) nextHook() func(context.Context, int, string, string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateCommittedAtFunc) appendCall(r0 StoreUpdateCommittedAtFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateCommittedAtFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdateCommittedAtFunc) History() []StoreUpdateCommittedAtFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateCommittedAtFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateCommittedAtFuncCall is an object that describes an invocation -// of method UpdateCommittedAt on an instance of MockStore. -type StoreUpdateCommittedAtFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 string - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 string - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateCommittedAtFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateCommittedAtFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdatePackageReferencesFunc describes the behavior when the -// UpdatePackageReferences method of the parent MockStore instance is -// invoked. -type StoreUpdatePackageReferencesFunc struct { - defaultHook func(context.Context, int, []precise.PackageReference) error - hooks []func(context.Context, int, []precise.PackageReference) error - history []StoreUpdatePackageReferencesFuncCall - mutex sync.Mutex -} - -// UpdatePackageReferences delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) UpdatePackageReferences(v0 context.Context, v1 int, v2 []precise.PackageReference) error { - r0 := m.UpdatePackageReferencesFunc.nextHook()(v0, v1, v2) - m.UpdatePackageReferencesFunc.appendCall(StoreUpdatePackageReferencesFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdatePackageReferences method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreUpdatePackageReferencesFunc) SetDefaultHook(hook func(context.Context, int, []precise.PackageReference) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdatePackageReferences method of the parent MockStore instance invokes -// the hook at the front of the queue and discards it. After the queue is -// empty, the default hook function is invoked for any future action. -func (f *StoreUpdatePackageReferencesFunc) PushHook(hook func(context.Context, int, []precise.PackageReference) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdatePackageReferencesFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, []precise.PackageReference) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdatePackageReferencesFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, []precise.PackageReference) error { - return r0 - }) -} - -func (f *StoreUpdatePackageReferencesFunc) nextHook() func(context.Context, int, []precise.PackageReference) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdatePackageReferencesFunc) appendCall(r0 StoreUpdatePackageReferencesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdatePackageReferencesFuncCall -// objects describing the invocations of this function. -func (f *StoreUpdatePackageReferencesFunc) History() []StoreUpdatePackageReferencesFuncCall { - f.mutex.Lock() - history := make([]StoreUpdatePackageReferencesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdatePackageReferencesFuncCall is an object that describes an -// invocation of method UpdatePackageReferences on an instance of MockStore. -type StoreUpdatePackageReferencesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []precise.PackageReference - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdatePackageReferencesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdatePackageReferencesFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdatePackagesFunc describes the behavior when the UpdatePackages -// method of the parent MockStore instance is invoked. -type StoreUpdatePackagesFunc struct { - defaultHook func(context.Context, int, []precise.Package) error - hooks []func(context.Context, int, []precise.Package) error - history []StoreUpdatePackagesFuncCall - mutex sync.Mutex -} - -// UpdatePackages delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) UpdatePackages(v0 context.Context, v1 int, v2 []precise.Package) error { - r0 := m.UpdatePackagesFunc.nextHook()(v0, v1, v2) - m.UpdatePackagesFunc.appendCall(StoreUpdatePackagesFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the UpdatePackages -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreUpdatePackagesFunc) SetDefaultHook(hook func(context.Context, int, []precise.Package) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdatePackages method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreUpdatePackagesFunc) PushHook(hook func(context.Context, int, []precise.Package) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdatePackagesFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, []precise.Package) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdatePackagesFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, []precise.Package) error { - return r0 - }) -} - -func (f *StoreUpdatePackagesFunc) nextHook() func(context.Context, int, []precise.Package) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdatePackagesFunc) appendCall(r0 StoreUpdatePackagesFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdatePackagesFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdatePackagesFunc) History() []StoreUpdatePackagesFuncCall { - f.mutex.Lock() - history := make([]StoreUpdatePackagesFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdatePackagesFuncCall is an object that describes an invocation of -// method UpdatePackages on an instance of MockStore. -type StoreUpdatePackagesFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []precise.Package - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdatePackagesFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdatePackagesFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdateUploadRetentionFunc describes the behavior when the -// UpdateUploadRetention method of the parent MockStore instance is invoked. -type StoreUpdateUploadRetentionFunc struct { - defaultHook func(context.Context, []int, []int) error - hooks []func(context.Context, []int, []int) error - history []StoreUpdateUploadRetentionFuncCall - mutex sync.Mutex -} - -// UpdateUploadRetention delegates to the next hook function in the queue -// and stores the parameter and result values of this invocation. -func (m *MockStore) UpdateUploadRetention(v0 context.Context, v1 []int, v2 []int) error { - r0 := m.UpdateUploadRetentionFunc.nextHook()(v0, v1, v2) - m.UpdateUploadRetentionFunc.appendCall(StoreUpdateUploadRetentionFuncCall{v0, v1, v2, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdateUploadRetention method of the parent MockStore instance is invoked -// and the hook queue is empty. -func (f *StoreUpdateUploadRetentionFunc) SetDefaultHook(hook func(context.Context, []int, []int) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateUploadRetention method of the parent MockStore instance invokes the -// hook at the front of the queue and discards it. After the queue is empty, -// the default hook function is invoked for any future action. -func (f *StoreUpdateUploadRetentionFunc) PushHook(hook func(context.Context, []int, []int) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateUploadRetentionFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, []int, []int) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateUploadRetentionFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, []int, []int) error { - return r0 - }) -} - -func (f *StoreUpdateUploadRetentionFunc) nextHook() func(context.Context, []int, []int) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateUploadRetentionFunc) appendCall(r0 StoreUpdateUploadRetentionFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateUploadRetentionFuncCall objects -// describing the invocations of this function. -func (f *StoreUpdateUploadRetentionFunc) History() []StoreUpdateUploadRetentionFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateUploadRetentionFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateUploadRetentionFuncCall is an object that describes an -// invocation of method UpdateUploadRetention on an instance of MockStore. -type StoreUpdateUploadRetentionFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 []int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 []int - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateUploadRetentionFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateUploadRetentionFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreUpdateUploadsVisibleToCommitsFunc describes the behavior when the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance is -// invoked. -type StoreUpdateUploadsVisibleToCommitsFunc struct { - defaultHook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error - hooks []func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error - history []StoreUpdateUploadsVisibleToCommitsFuncCall - mutex sync.Mutex -} - -// UpdateUploadsVisibleToCommits delegates to the next hook function in the -// queue and stores the parameter and result values of this invocation. -func (m *MockStore) UpdateUploadsVisibleToCommits(v0 context.Context, v1 int, v2 *commitgraph.CommitGraph, v3 map[string][]gitdomain.Ref, v4 time.Duration, v5 time.Duration, v6 int, v7 time.Time) error { - r0 := m.UpdateUploadsVisibleToCommitsFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6, v7) - m.UpdateUploadsVisibleToCommitsFunc.appendCall(StoreUpdateUploadsVisibleToCommitsFuncCall{v0, v1, v2, v3, v4, v5, v6, v7, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance is -// invoked and the hook queue is empty. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) SetDefaultHook(hook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// UpdateUploadsVisibleToCommits method of the parent MockStore instance -// invokes the hook at the front of the queue and discards it. After the -// queue is empty, the default hook function is invoked for any future -// action. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) PushHook(hook func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - return r0 - }) -} - -func (f *StoreUpdateUploadsVisibleToCommitsFunc) nextHook() func(context.Context, int, *commitgraph.CommitGraph, map[string][]gitdomain.Ref, time.Duration, time.Duration, int, time.Time) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreUpdateUploadsVisibleToCommitsFunc) appendCall(r0 StoreUpdateUploadsVisibleToCommitsFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreUpdateUploadsVisibleToCommitsFuncCall -// objects describing the invocations of this function. -func (f *StoreUpdateUploadsVisibleToCommitsFunc) History() []StoreUpdateUploadsVisibleToCommitsFuncCall { - f.mutex.Lock() - history := make([]StoreUpdateUploadsVisibleToCommitsFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreUpdateUploadsVisibleToCommitsFuncCall is an object that describes an -// invocation of method UpdateUploadsVisibleToCommits on an instance of -// MockStore. -type StoreUpdateUploadsVisibleToCommitsFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 int - // Arg2 is the value of the 3rd argument passed to this method - // invocation. - Arg2 *commitgraph.CommitGraph - // Arg3 is the value of the 4th argument passed to this method - // invocation. - Arg3 map[string][]gitdomain.Ref - // Arg4 is the value of the 5th argument passed to this method - // invocation. - Arg4 time.Duration - // Arg5 is the value of the 6th argument passed to this method - // invocation. - Arg5 time.Duration - // Arg6 is the value of the 7th argument passed to this method - // invocation. - Arg6 int - // Arg7 is the value of the 8th argument passed to this method - // invocation. - Arg7 time.Time - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreUpdateUploadsVisibleToCommitsFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5, c.Arg6, c.Arg7} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreUpdateUploadsVisibleToCommitsFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreWithTransactionFunc describes the behavior when the WithTransaction -// method of the parent MockStore instance is invoked. -type StoreWithTransactionFunc struct { - defaultHook func(context.Context, func(s store.Store) error) error - hooks []func(context.Context, func(s store.Store) error) error - history []StoreWithTransactionFuncCall - mutex sync.Mutex -} - -// WithTransaction delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) WithTransaction(v0 context.Context, v1 func(s store.Store) error) error { - r0 := m.WithTransactionFunc.nextHook()(v0, v1) - m.WithTransactionFunc.appendCall(StoreWithTransactionFuncCall{v0, v1, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the WithTransaction -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreWithTransactionFunc) SetDefaultHook(hook func(context.Context, func(s store.Store) error) error) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// WithTransaction method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreWithTransactionFunc) PushHook(hook func(context.Context, func(s store.Store) error) error) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreWithTransactionFunc) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, func(s store.Store) error) error { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreWithTransactionFunc) PushReturn(r0 error) { - f.PushHook(func(context.Context, func(s store.Store) error) error { - return r0 - }) -} - -func (f *StoreWithTransactionFunc) nextHook() func(context.Context, func(s store.Store) error) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreWithTransactionFunc) appendCall(r0 StoreWithTransactionFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreWithTransactionFuncCall objects -// describing the invocations of this function. -func (f *StoreWithTransactionFunc) History() []StoreWithTransactionFuncCall { - f.mutex.Lock() - history := make([]StoreWithTransactionFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreWithTransactionFuncCall is an object that describes an invocation of -// method WithTransaction on an instance of MockStore. -type StoreWithTransactionFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 context.Context - // Arg1 is the value of the 2nd argument passed to this method - // invocation. - Arg1 func(s store.Store) error - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 error -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreWithTransactionFuncCall) Args() []interface{} { - return []interface{}{c.Arg0, c.Arg1} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreWithTransactionFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - -// StoreWorkerutilStoreFunc describes the behavior when the WorkerutilStore -// method of the parent MockStore instance is invoked. -type StoreWorkerutilStoreFunc struct { - defaultHook func(*observation.Context) store1.Store[shared.Upload] - hooks []func(*observation.Context) store1.Store[shared.Upload] - history []StoreWorkerutilStoreFuncCall - mutex sync.Mutex -} - -// WorkerutilStore delegates to the next hook function in the queue and -// stores the parameter and result values of this invocation. -func (m *MockStore) WorkerutilStore(v0 *observation.Context) store1.Store[shared.Upload] { - r0 := m.WorkerutilStoreFunc.nextHook()(v0) - m.WorkerutilStoreFunc.appendCall(StoreWorkerutilStoreFuncCall{v0, r0}) - return r0 -} - -// SetDefaultHook sets function that is called when the WorkerutilStore -// method of the parent MockStore instance is invoked and the hook queue is -// empty. -func (f *StoreWorkerutilStoreFunc) SetDefaultHook(hook func(*observation.Context) store1.Store[shared.Upload]) { - f.defaultHook = hook -} - -// PushHook adds a function to the end of hook queue. Each invocation of the -// WorkerutilStore method of the parent MockStore instance invokes the hook -// at the front of the queue and discards it. After the queue is empty, the -// default hook function is invoked for any future action. -func (f *StoreWorkerutilStoreFunc) PushHook(hook func(*observation.Context) store1.Store[shared.Upload]) { - f.mutex.Lock() - f.hooks = append(f.hooks, hook) - f.mutex.Unlock() -} - -// SetDefaultReturn calls SetDefaultHook with a function that returns the -// given values. -func (f *StoreWorkerutilStoreFunc) SetDefaultReturn(r0 store1.Store[shared.Upload]) { - f.SetDefaultHook(func(*observation.Context) store1.Store[shared.Upload] { - return r0 - }) -} - -// PushReturn calls PushHook with a function that returns the given values. -func (f *StoreWorkerutilStoreFunc) PushReturn(r0 store1.Store[shared.Upload]) { - f.PushHook(func(*observation.Context) store1.Store[shared.Upload] { - return r0 - }) -} - -func (f *StoreWorkerutilStoreFunc) nextHook() func(*observation.Context) store1.Store[shared.Upload] { - f.mutex.Lock() - defer f.mutex.Unlock() - - if len(f.hooks) == 0 { - return f.defaultHook - } - - hook := f.hooks[0] - f.hooks = f.hooks[1:] - return hook -} - -func (f *StoreWorkerutilStoreFunc) appendCall(r0 StoreWorkerutilStoreFuncCall) { - f.mutex.Lock() - f.history = append(f.history, r0) - f.mutex.Unlock() -} - -// History returns a sequence of StoreWorkerutilStoreFuncCall objects -// describing the invocations of this function. -func (f *StoreWorkerutilStoreFunc) History() []StoreWorkerutilStoreFuncCall { - f.mutex.Lock() - history := make([]StoreWorkerutilStoreFuncCall, len(f.history)) - copy(history, f.history) - f.mutex.Unlock() - - return history -} - -// StoreWorkerutilStoreFuncCall is an object that describes an invocation of -// method WorkerutilStore on an instance of MockStore. -type StoreWorkerutilStoreFuncCall struct { - // Arg0 is the value of the 1st argument passed to this method - // invocation. - Arg0 *observation.Context - // Result0 is the value of the 1st result returned from this method - // invocation. - Result0 store1.Store[shared.Upload] -} - -// Args returns an interface slice containing the arguments of this -// invocation. -func (c StoreWorkerutilStoreFuncCall) Args() []interface{} { - return []interface{}{c.Arg0} -} - -// Results returns an interface slice containing the results of this -// invocation. -func (c StoreWorkerutilStoreFuncCall) Results() []interface{} { - return []interface{}{c.Result0} -} - // MockWorkerStore is a mock implementation of the Store interface (from the // package // github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store) @@ -8435,7 +222,7 @@ type MockWorkerStore[T workerutil.Record] struct { func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (r0 int, r1 error) { + defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (r0 int, r1 error) { return }, }, @@ -8450,22 +237,22 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{ - defaultHook: func(context.Context, []string, store1.HeartbeatOptions) (r0 []string, r1 []string, r2 error) { + defaultHook: func(context.Context, []string, store.HeartbeatOptions) (r0 []string, r1 []string, r2 error) { return }, }, MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{ - defaultHook: func(context.Context, int, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (r0 bool, r1 error) { return }, }, @@ -8490,12 +277,12 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (r0 error) { + defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (r0 error) { return }, }, WithFunc: &WorkerStoreWithFunc[T]{ - defaultHook: func(basestore.ShareableStore) (r0 store1.Store[T]) { + defaultHook: func(basestore.ShareableStore) (r0 store.Store[T]) { return }, }, @@ -8507,7 +294,7 @@ func NewMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { panic("unexpected invocation of MockWorkerStore.AddExecutionLogEntry") }, }, @@ -8522,22 +309,22 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{ - defaultHook: func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + defaultHook: func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { panic("unexpected invocation of MockWorkerStore.Heartbeat") }, }, MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{ - defaultHook: func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkComplete") }, }, MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkErrored") }, }, MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{ - defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + defaultHook: func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { panic("unexpected invocation of MockWorkerStore.MarkFailed") }, }, @@ -8562,12 +349,12 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { }, }, UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{ - defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { panic("unexpected invocation of MockWorkerStore.UpdateExecutionLogEntry") }, }, WithFunc: &WorkerStoreWithFunc[T]{ - defaultHook: func(basestore.ShareableStore) store1.Store[T] { + defaultHook: func(basestore.ShareableStore) store.Store[T] { panic("unexpected invocation of MockWorkerStore.With") }, }, @@ -8577,7 +364,7 @@ func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] { // NewMockWorkerStoreFrom creates a new mock of the MockWorkerStore // interface. All methods delegate to the given implementation, unless // overwritten. -func NewMockWorkerStoreFrom[T workerutil.Record](i store1.Store[T]) *MockWorkerStore[T] { +func NewMockWorkerStoreFrom[T workerutil.Record](i store.Store[T]) *MockWorkerStore[T] { return &MockWorkerStore[T]{ AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{ defaultHook: i.AddExecutionLogEntry, @@ -8625,15 +412,15 @@ func NewMockWorkerStoreFrom[T workerutil.Record](i store1.Store[T]) *MockWorkerS // AddExecutionLogEntry method of the parent MockWorkerStore instance is // invoked. type WorkerStoreAddExecutionLogEntryFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) - hooks []func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) + defaultHook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) + hooks []func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) history []WorkerStoreAddExecutionLogEntryFuncCall[T] mutex sync.Mutex } // AddExecutionLogEntry delegates to the next hook function in the queue and // stores the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 executor.ExecutionLogEntry, v3 store1.ExecutionLogEntryOptions) (int, error) { +func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 executor.ExecutionLogEntry, v3 store.ExecutionLogEntryOptions) (int, error) { r0, r1 := m.AddExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3) m.AddExecutionLogEntryFunc.appendCall(WorkerStoreAddExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -8642,7 +429,7 @@ func (m *MockWorkerStore[T]) AddExecutionLogEntry(v0 context.Context, v1 int, v2 // SetDefaultHook sets function that is called when the AddExecutionLogEntry // method of the parent MockWorkerStore instance is invoked and the hook // queue is empty. -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error)) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error)) { f.defaultHook = hook } @@ -8651,7 +438,7 @@ func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultHook(hook func(contex // invokes the hook at the front of the queue and discards it. After the // queue is empty, the default hook function is invoked for any future // action. -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error)) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -8660,19 +447,19 @@ func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Cont // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultReturn(r0 int, r1 error) { - f.SetDefaultHook(func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + f.SetDefaultHook(func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreAddExecutionLogEntryFunc[T]) PushReturn(r0 int, r1 error) { - f.PushHook(func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { + f.PushHook(func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { return r0, r1 }) } -func (f *WorkerStoreAddExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) { +func (f *WorkerStoreAddExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -8717,7 +504,7 @@ type WorkerStoreAddExecutionLogEntryFuncCall[T workerutil.Record] struct { Arg2 executor.ExecutionLogEntry // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.ExecutionLogEntryOptions + Arg3 store.ExecutionLogEntryOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 int @@ -8953,15 +740,15 @@ func (c WorkerStoreHandleFuncCall[T]) Results() []interface{} { // WorkerStoreHeartbeatFunc describes the behavior when the Heartbeat method // of the parent MockWorkerStore instance is invoked. type WorkerStoreHeartbeatFunc[T workerutil.Record] struct { - defaultHook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) - hooks []func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) + defaultHook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) + hooks []func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) history []WorkerStoreHeartbeatFuncCall[T] mutex sync.Mutex } // Heartbeat delegates to the next hook function in the queue and stores the // parameter and result values of this invocation. -func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store1.HeartbeatOptions) ([]string, []string, error) { +func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store.HeartbeatOptions) ([]string, []string, error) { r0, r1, r2 := m.HeartbeatFunc.nextHook()(v0, v1, v2) m.HeartbeatFunc.appendCall(WorkerStoreHeartbeatFuncCall[T]{v0, v1, v2, r0, r1, r2}) return r0, r1, r2 @@ -8970,7 +757,7 @@ func (m *MockWorkerStore[T]) Heartbeat(v0 context.Context, v1 []string, v2 store // SetDefaultHook sets function that is called when the Heartbeat method of // the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error)) { +func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error)) { f.defaultHook = hook } @@ -8978,7 +765,7 @@ func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultHook(hook func(context.Context, // Heartbeat method of the parent MockWorkerStore instance invokes the hook // at the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error)) { +func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -8987,19 +774,19 @@ func (f *WorkerStoreHeartbeatFunc[T]) PushHook(hook func(context.Context, []stri // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreHeartbeatFunc[T]) SetDefaultReturn(r0 []string, r1 []string, r2 error) { - f.SetDefaultHook(func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + f.SetDefaultHook(func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { return r0, r1, r2 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreHeartbeatFunc[T]) PushReturn(r0 []string, r1 []string, r2 error) { - f.PushHook(func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { + f.PushHook(func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { return r0, r1, r2 }) } -func (f *WorkerStoreHeartbeatFunc[T]) nextHook() func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) { +func (f *WorkerStoreHeartbeatFunc[T]) nextHook() func(context.Context, []string, store.HeartbeatOptions) ([]string, []string, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9040,7 +827,7 @@ type WorkerStoreHeartbeatFuncCall[T workerutil.Record] struct { Arg1 []string // Arg2 is the value of the 3rd argument passed to this method // invocation. - Arg2 store1.HeartbeatOptions + Arg2 store.HeartbeatOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 []string @@ -9067,15 +854,15 @@ func (c WorkerStoreHeartbeatFuncCall[T]) Results() []interface{} { // WorkerStoreMarkCompleteFunc describes the behavior when the MarkComplete // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkCompleteFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkCompleteFuncCall[T] mutex sync.Mutex } // MarkComplete delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkCompleteFunc.nextHook()(v0, v1, v2) m.MarkCompleteFunc.appendCall(WorkerStoreMarkCompleteFuncCall[T]{v0, v1, v2, r0, r1}) return r0, r1 @@ -9084,7 +871,7 @@ func (m *MockWorkerStore[T]) MarkComplete(v0 context.Context, v1 int, v2 store1. // SetDefaultHook sets function that is called when the MarkComplete method // of the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Context, int, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Context, int, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9092,7 +879,7 @@ func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultHook(hook func(context.Contex // MarkComplete method of the parent MockWorkerStore instance invokes the // hook at the front of the queue and discards it. After the queue is empty, // the default hook function is invoked for any future action. -func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9101,19 +888,19 @@ func (f *WorkerStoreMarkCompleteFunc[T]) PushHook(hook func(context.Context, int // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkCompleteFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkCompleteFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkCompleteFunc[T]) nextHook() func(context.Context, int, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkCompleteFunc[T]) nextHook() func(context.Context, int, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9154,7 +941,7 @@ type WorkerStoreMarkCompleteFuncCall[T workerutil.Record] struct { Arg1 int // Arg2 is the value of the 3rd argument passed to this method // invocation. - Arg2 store1.MarkFinalOptions + Arg2 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -9178,15 +965,15 @@ func (c WorkerStoreMarkCompleteFuncCall[T]) Results() []interface{} { // WorkerStoreMarkErroredFunc describes the behavior when the MarkErrored // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkErroredFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, string, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, string, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkErroredFuncCall[T] mutex sync.Mutex } // MarkErrored delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, v3 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, v3 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkErroredFunc.nextHook()(v0, v1, v2, v3) m.MarkErroredFunc.appendCall(WorkerStoreMarkErroredFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -9195,7 +982,7 @@ func (m *MockWorkerStore[T]) MarkErrored(v0 context.Context, v1 int, v2 string, // SetDefaultHook sets function that is called when the MarkErrored method // of the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9203,7 +990,7 @@ func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultHook(hook func(context.Context // MarkErrored method of the parent MockWorkerStore instance invokes the // hook at the front of the queue and discards it. After the queue is empty, // the default hook function is invoked for any future action. -func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9212,19 +999,19 @@ func (f *WorkerStoreMarkErroredFunc[T]) PushHook(hook func(context.Context, int, // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkErroredFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkErroredFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkErroredFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkErroredFunc[T]) nextHook() func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9268,7 +1055,7 @@ type WorkerStoreMarkErroredFuncCall[T workerutil.Record] struct { Arg2 string // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.MarkFinalOptions + Arg3 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -9292,15 +1079,15 @@ func (c WorkerStoreMarkErroredFuncCall[T]) Results() []interface{} { // WorkerStoreMarkFailedFunc describes the behavior when the MarkFailed // method of the parent MockWorkerStore instance is invoked. type WorkerStoreMarkFailedFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) - hooks []func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) + defaultHook func(context.Context, int, string, store.MarkFinalOptions) (bool, error) + hooks []func(context.Context, int, string, store.MarkFinalOptions) (bool, error) history []WorkerStoreMarkFailedFuncCall[T] mutex sync.Mutex } // MarkFailed delegates to the next hook function in the queue and stores // the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v3 store1.MarkFinalOptions) (bool, error) { +func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v3 store.MarkFinalOptions) (bool, error) { r0, r1 := m.MarkFailedFunc.nextHook()(v0, v1, v2, v3) m.MarkFailedFunc.appendCall(WorkerStoreMarkFailedFuncCall[T]{v0, v1, v2, v3, r0, r1}) return r0, r1 @@ -9309,7 +1096,7 @@ func (m *MockWorkerStore[T]) MarkFailed(v0 context.Context, v1 int, v2 string, v // SetDefaultHook sets function that is called when the MarkFailed method of // the parent MockWorkerStore instance is invoked and the hook queue is // empty. -func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.defaultHook = hook } @@ -9317,7 +1104,7 @@ func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultHook(hook func(context.Context, // MarkFailed method of the parent MockWorkerStore instance invokes the hook // at the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, string, store1.MarkFinalOptions) (bool, error)) { +func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9326,19 +1113,19 @@ func (f *WorkerStoreMarkFailedFunc[T]) PushHook(hook func(context.Context, int, // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreMarkFailedFunc[T]) SetDefaultReturn(r0 bool, r1 error) { - f.SetDefaultHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.SetDefaultHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreMarkFailedFunc[T]) PushReturn(r0 bool, r1 error) { - f.PushHook(func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { + f.PushHook(func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { return r0, r1 }) } -func (f *WorkerStoreMarkFailedFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) { +func (f *WorkerStoreMarkFailedFunc[T]) nextHook() func(context.Context, int, string, store.MarkFinalOptions) (bool, error) { f.mutex.Lock() defer f.mutex.Unlock() @@ -9382,7 +1169,7 @@ type WorkerStoreMarkFailedFuncCall[T workerutil.Record] struct { Arg2 string // Arg3 is the value of the 4th argument passed to this method // invocation. - Arg3 store1.MarkFinalOptions + Arg3 store.MarkFinalOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 bool @@ -9838,15 +1625,15 @@ func (c WorkerStoreResetStalledFuncCall[T]) Results() []interface{} { // UpdateExecutionLogEntry method of the parent MockWorkerStore instance is // invoked. type WorkerStoreUpdateExecutionLogEntryFunc[T workerutil.Record] struct { - defaultHook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error - hooks []func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error + defaultHook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error + hooks []func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error history []WorkerStoreUpdateExecutionLogEntryFuncCall[T] mutex sync.Mutex } // UpdateExecutionLogEntry delegates to the next hook function in the queue // and stores the parameter and result values of this invocation. -func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, v2 int, v3 executor.ExecutionLogEntry, v4 store1.ExecutionLogEntryOptions) error { +func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, v2 int, v3 executor.ExecutionLogEntry, v4 store.ExecutionLogEntryOptions) error { r0 := m.UpdateExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3, v4) m.UpdateExecutionLogEntryFunc.appendCall(WorkerStoreUpdateExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, v4, r0}) return r0 @@ -9855,7 +1642,7 @@ func (m *MockWorkerStore[T]) UpdateExecutionLogEntry(v0 context.Context, v1 int, // SetDefaultHook sets function that is called when the // UpdateExecutionLogEntry method of the parent MockWorkerStore instance is // invoked and the hook queue is empty. -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error) { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error) { f.defaultHook = hook } @@ -9864,7 +1651,7 @@ func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultHook(hook func(con // invokes the hook at the front of the queue and discards it. After the // queue is empty, the default hook function is invoked for any future // action. -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error) { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9873,19 +1660,19 @@ func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.C // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultReturn(r0 error) { - f.SetDefaultHook(func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + f.SetDefaultHook(func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { return r0 }) } // PushReturn calls PushHook with a function that returns the given values. func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushReturn(r0 error) { - f.PushHook(func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { + f.PushHook(func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { return r0 }) } -func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error { +func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, int, executor.ExecutionLogEntry, store.ExecutionLogEntryOptions) error { f.mutex.Lock() defer f.mutex.Unlock() @@ -9933,7 +1720,7 @@ type WorkerStoreUpdateExecutionLogEntryFuncCall[T workerutil.Record] struct { Arg3 executor.ExecutionLogEntry // Arg4 is the value of the 5th argument passed to this method // invocation. - Arg4 store1.ExecutionLogEntryOptions + Arg4 store.ExecutionLogEntryOptions // Result0 is the value of the 1st result returned from this method // invocation. Result0 error @@ -9954,15 +1741,15 @@ func (c WorkerStoreUpdateExecutionLogEntryFuncCall[T]) Results() []interface{} { // WorkerStoreWithFunc describes the behavior when the With method of the // parent MockWorkerStore instance is invoked. type WorkerStoreWithFunc[T workerutil.Record] struct { - defaultHook func(basestore.ShareableStore) store1.Store[T] - hooks []func(basestore.ShareableStore) store1.Store[T] + defaultHook func(basestore.ShareableStore) store.Store[T] + hooks []func(basestore.ShareableStore) store.Store[T] history []WorkerStoreWithFuncCall[T] mutex sync.Mutex } // With delegates to the next hook function in the queue and stores the // parameter and result values of this invocation. -func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store1.Store[T] { +func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store.Store[T] { r0 := m.WithFunc.nextHook()(v0) m.WithFunc.appendCall(WorkerStoreWithFuncCall[T]{v0, r0}) return r0 @@ -9970,7 +1757,7 @@ func (m *MockWorkerStore[T]) With(v0 basestore.ShareableStore) store1.Store[T] { // SetDefaultHook sets function that is called when the With method of the // parent MockWorkerStore instance is invoked and the hook queue is empty. -func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableStore) store1.Store[T]) { +func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableStore) store.Store[T]) { f.defaultHook = hook } @@ -9978,7 +1765,7 @@ func (f *WorkerStoreWithFunc[T]) SetDefaultHook(hook func(basestore.ShareableSto // With method of the parent MockWorkerStore instance invokes the hook at // the front of the queue and discards it. After the queue is empty, the // default hook function is invoked for any future action. -func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) store1.Store[T]) { +func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) store.Store[T]) { f.mutex.Lock() f.hooks = append(f.hooks, hook) f.mutex.Unlock() @@ -9986,20 +1773,20 @@ func (f *WorkerStoreWithFunc[T]) PushHook(hook func(basestore.ShareableStore) st // SetDefaultReturn calls SetDefaultHook with a function that returns the // given values. -func (f *WorkerStoreWithFunc[T]) SetDefaultReturn(r0 store1.Store[T]) { - f.SetDefaultHook(func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) SetDefaultReturn(r0 store.Store[T]) { + f.SetDefaultHook(func(basestore.ShareableStore) store.Store[T] { return r0 }) } // PushReturn calls PushHook with a function that returns the given values. -func (f *WorkerStoreWithFunc[T]) PushReturn(r0 store1.Store[T]) { - f.PushHook(func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) PushReturn(r0 store.Store[T]) { + f.PushHook(func(basestore.ShareableStore) store.Store[T] { return r0 }) } -func (f *WorkerStoreWithFunc[T]) nextHook() func(basestore.ShareableStore) store1.Store[T] { +func (f *WorkerStoreWithFunc[T]) nextHook() func(basestore.ShareableStore) store.Store[T] { f.mutex.Lock() defer f.mutex.Unlock() @@ -10037,7 +1824,7 @@ type WorkerStoreWithFuncCall[T workerutil.Record] struct { Arg0 basestore.ShareableStore // Result0 is the value of the 1st result returned from this method // invocation. - Result0 store1.Store[T] + Result0 store.Store[T] } // Args returns an interface slice containing the arguments of this diff --git a/internal/codeintel/uploads/internal/storemocks/BUILD.bazel b/internal/codeintel/uploads/internal/storemocks/BUILD.bazel new file mode 100644 index 00000000000..74a05d9896f --- /dev/null +++ b/internal/codeintel/uploads/internal/storemocks/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//dev:go_mockgen.bzl", "go_mockgen") + +go_library( + name = "storemocks", + srcs = ["mocks_temp.go"], + importpath = "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/storemocks", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/api", + "//internal/codeintel/core", + "//internal/codeintel/uploads/internal/commitgraph", + "//internal/codeintel/uploads/internal/store", + "//internal/codeintel/uploads/shared", + "//internal/database/basestore", + "//internal/gitserver/gitdomain", + "//internal/observation", + "//internal/workerutil/dbworker/store", + "//lib/codeintel/precise", + ], +) + +go_mockgen( + name = "generate_mocks", + out = "mocks_temp.go", + manifests = [ + "//:mockgen.yaml", + "//:mockgen.test.yaml", + "//:mockgen.temp.yaml", + ], + deps = ["//internal/codeintel/uploads/internal/store"], +) diff --git a/internal/codeintel/uploads/internal/background/backfiller/mocks_test.go b/internal/codeintel/uploads/internal/storemocks/mocks_temp.go similarity index 99% rename from internal/codeintel/uploads/internal/background/backfiller/mocks_test.go rename to internal/codeintel/uploads/internal/storemocks/mocks_temp.go index b7a04844d3e..c0619c69d2f 100644 --- a/internal/codeintel/uploads/internal/background/backfiller/mocks_test.go +++ b/internal/codeintel/uploads/internal/storemocks/mocks_temp.go @@ -4,7 +4,7 @@ // this repository. To add additional mocks to this or another package, add a new entry // to the mockgen.yaml file in the root of this repository. -package backfiller +package storemocks import ( "context" diff --git a/mockgen.temp.yaml b/mockgen.temp.yaml index 2c6d738eefd..1f6cc07767d 100644 --- a/mockgen.temp.yaml +++ b/mockgen.temp.yaml @@ -185,3 +185,8 @@ interfaces: - DataStore - SCIPWriter +- filename: internal/codeintel/uploads/internal/storemocks/mocks_temp.go + sources: + - path: github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store + interfaces: + - Store diff --git a/mockgen.test.yaml b/mockgen.test.yaml index c035458c112..6af5c7fa8e0 100644 --- a/mockgen.test.yaml +++ b/mockgen.test.yaml @@ -232,9 +232,6 @@ - path: github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/background/processor interfaces: - RepoStore - - path: github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store - interfaces: - - Store - path: github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store interfaces: - Store @@ -245,18 +242,10 @@ interfaces: - PolicyService - PolicyMatcher - - path: github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store - interfaces: - - Store - path: github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store interfaces: - Store prefix: Worker -- filename: internal/codeintel/uploads/internal/background/backfiller/mocks_test.go - sources: - - path: github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store - interfaces: - - Store - filename: internal/database/migration/runner/mocks_test.go path: github.com/sourcegraph/sourcegraph/internal/database/migration/runner interfaces: