mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
Also renames a bunch of related types such as - config.IndexJob -> config.AutoIndexJobSpec - IndexLoader -> AutoIndexJobLoader and so on.
11517 lines
420 KiB
Go
Generated
11517 lines
420 KiB
Go
Generated
// Code generated by go-mockgen 1.3.7; DO NOT EDIT.
|
|
//
|
|
// This file was generated by running `sg generate` (or `go-mockgen`) at the root of
|
|
// 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 uploads
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
"time"
|
|
|
|
sqlf "github.com/keegancsmith/sqlf"
|
|
api "github.com/sourcegraph/sourcegraph/internal/api"
|
|
core "github.com/sourcegraph/sourcegraph/internal/codeintel/core"
|
|
shared1 "github.com/sourcegraph/sourcegraph/internal/codeintel/policies/shared"
|
|
commitgraph "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/commitgraph"
|
|
lsifstore "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/lsifstore"
|
|
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"
|
|
)
|
|
|
|
// 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}
|
|
}
|
|
|
|
// MockRepoStore is a mock implementation of the RepoStore interface (from
|
|
// the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockRepoStore struct {
|
|
// GetFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Get.
|
|
GetFunc *RepoStoreGetFunc
|
|
}
|
|
|
|
// NewMockRepoStore creates a new mock of the RepoStore interface. All
|
|
// methods return zero values for all results, unless overwritten.
|
|
func NewMockRepoStore() *MockRepoStore {
|
|
return &MockRepoStore{
|
|
GetFunc: &RepoStoreGetFunc{
|
|
defaultHook: func(context.Context, api.RepoID) (r0 *types.Repo, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockRepoStore creates a new mock of the RepoStore interface. All
|
|
// methods panic on invocation, unless overwritten.
|
|
func NewStrictMockRepoStore() *MockRepoStore {
|
|
return &MockRepoStore{
|
|
GetFunc: &RepoStoreGetFunc{
|
|
defaultHook: func(context.Context, api.RepoID) (*types.Repo, error) {
|
|
panic("unexpected invocation of MockRepoStore.Get")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockRepoStoreFrom creates a new mock of the MockRepoStore interface.
|
|
// All methods delegate to the given implementation, unless overwritten.
|
|
func NewMockRepoStoreFrom(i RepoStore) *MockRepoStore {
|
|
return &MockRepoStore{
|
|
GetFunc: &RepoStoreGetFunc{
|
|
defaultHook: i.Get,
|
|
},
|
|
}
|
|
}
|
|
|
|
// RepoStoreGetFunc describes the behavior when the Get method of the parent
|
|
// MockRepoStore instance is invoked.
|
|
type RepoStoreGetFunc struct {
|
|
defaultHook func(context.Context, api.RepoID) (*types.Repo, error)
|
|
hooks []func(context.Context, api.RepoID) (*types.Repo, error)
|
|
history []RepoStoreGetFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Get delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockRepoStore) Get(v0 context.Context, v1 api.RepoID) (*types.Repo, error) {
|
|
r0, r1 := m.GetFunc.nextHook()(v0, v1)
|
|
m.GetFunc.appendCall(RepoStoreGetFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Get method of the
|
|
// parent MockRepoStore instance is invoked and the hook queue is empty.
|
|
func (f *RepoStoreGetFunc) SetDefaultHook(hook func(context.Context, api.RepoID) (*types.Repo, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Get method of the parent MockRepoStore 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 *RepoStoreGetFunc) PushHook(hook func(context.Context, api.RepoID) (*types.Repo, 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 *RepoStoreGetFunc) SetDefaultReturn(r0 *types.Repo, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, api.RepoID) (*types.Repo, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *RepoStoreGetFunc) PushReturn(r0 *types.Repo, r1 error) {
|
|
f.PushHook(func(context.Context, api.RepoID) (*types.Repo, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *RepoStoreGetFunc) nextHook() func(context.Context, api.RepoID) (*types.Repo, 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 *RepoStoreGetFunc) appendCall(r0 RepoStoreGetFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of RepoStoreGetFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *RepoStoreGetFunc) History() []RepoStoreGetFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]RepoStoreGetFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// RepoStoreGetFuncCall is an object that describes an invocation of method
|
|
// Get on an instance of MockRepoStore.
|
|
type RepoStoreGetFuncCall 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 *types.Repo
|
|
// 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 RepoStoreGetFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c RepoStoreGetFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// MockLSIFStore is a mock implementation of the Store interface (from the
|
|
// package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/lsifstore)
|
|
// used for unit testing.
|
|
type MockLSIFStore struct {
|
|
// DeleteAbandonedSchemaVersionsRecordsFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// DeleteAbandonedSchemaVersionsRecords.
|
|
DeleteAbandonedSchemaVersionsRecordsFunc *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc
|
|
// DeleteLsifDataByUploadIdsFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteLsifDataByUploadIds.
|
|
DeleteLsifDataByUploadIdsFunc *LSIFStoreDeleteLsifDataByUploadIdsFunc
|
|
// DeleteUnreferencedDocumentsFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteUnreferencedDocuments.
|
|
DeleteUnreferencedDocumentsFunc *LSIFStoreDeleteUnreferencedDocumentsFunc
|
|
// IDsWithMetaFunc is an instance of a mock function object controlling
|
|
// the behavior of the method IDsWithMeta.
|
|
IDsWithMetaFunc *LSIFStoreIDsWithMetaFunc
|
|
// InsertMetadataFunc is an instance of a mock function object
|
|
// controlling the behavior of the method InsertMetadata.
|
|
InsertMetadataFunc *LSIFStoreInsertMetadataFunc
|
|
// NewPreciseSCIPWriterFunc is an instance of a mock function object
|
|
// controlling the behavior of the method NewPreciseSCIPWriter.
|
|
NewPreciseSCIPWriterFunc *LSIFStoreNewPreciseSCIPWriterFunc
|
|
// NewSyntacticSCIPWriterFunc is an instance of a mock function object
|
|
// controlling the behavior of the method NewSyntacticSCIPWriter.
|
|
NewSyntacticSCIPWriterFunc *LSIFStoreNewSyntacticSCIPWriterFunc
|
|
// ReconcileCandidatesFunc is an instance of a mock function object
|
|
// controlling the behavior of the method ReconcileCandidates.
|
|
ReconcileCandidatesFunc *LSIFStoreReconcileCandidatesFunc
|
|
// ReconcileCandidatesWithTimeFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// ReconcileCandidatesWithTime.
|
|
ReconcileCandidatesWithTimeFunc *LSIFStoreReconcileCandidatesWithTimeFunc
|
|
// WithTransactionFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WithTransaction.
|
|
WithTransactionFunc *LSIFStoreWithTransactionFunc
|
|
}
|
|
|
|
// NewMockLSIFStore creates a new mock of the Store interface. All methods
|
|
// return zero values for all results, unless overwritten.
|
|
func NewMockLSIFStore() *MockLSIFStore {
|
|
return &MockLSIFStore{
|
|
DeleteAbandonedSchemaVersionsRecordsFunc: &LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc{
|
|
defaultHook: func(context.Context) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteLsifDataByUploadIdsFunc: &LSIFStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: func(context.Context, ...int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteUnreferencedDocumentsFunc: &LSIFStoreDeleteUnreferencedDocumentsFunc{
|
|
defaultHook: func(context.Context, int, time.Duration, time.Time) (r0 int, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
IDsWithMetaFunc: &LSIFStoreIDsWithMetaFunc{
|
|
defaultHook: func(context.Context, []int) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
InsertMetadataFunc: &LSIFStoreInsertMetadataFunc{
|
|
defaultHook: func(context.Context, int, lsifstore.ProcessedMetadata) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
NewPreciseSCIPWriterFunc: &LSIFStoreNewPreciseSCIPWriterFunc{
|
|
defaultHook: func(context.Context, int) (r0 lsifstore.SCIPWriter, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
NewSyntacticSCIPWriterFunc: &LSIFStoreNewSyntacticSCIPWriterFunc{
|
|
defaultHook: func(int) (r0 lsifstore.SCIPWriter, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
ReconcileCandidatesFunc: &LSIFStoreReconcileCandidatesFunc{
|
|
defaultHook: func(context.Context, int) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
ReconcileCandidatesWithTimeFunc: &LSIFStoreReconcileCandidatesWithTimeFunc{
|
|
defaultHook: func(context.Context, int, time.Time) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WithTransactionFunc: &LSIFStoreWithTransactionFunc{
|
|
defaultHook: func(context.Context, func(s lsifstore.Store) error) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockLSIFStore creates a new mock of the Store interface. All
|
|
// methods panic on invocation, unless overwritten.
|
|
func NewStrictMockLSIFStore() *MockLSIFStore {
|
|
return &MockLSIFStore{
|
|
DeleteAbandonedSchemaVersionsRecordsFunc: &LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc{
|
|
defaultHook: func(context.Context) (int, error) {
|
|
panic("unexpected invocation of MockLSIFStore.DeleteAbandonedSchemaVersionsRecords")
|
|
},
|
|
},
|
|
DeleteLsifDataByUploadIdsFunc: &LSIFStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: func(context.Context, ...int) error {
|
|
panic("unexpected invocation of MockLSIFStore.DeleteLsifDataByUploadIds")
|
|
},
|
|
},
|
|
DeleteUnreferencedDocumentsFunc: &LSIFStoreDeleteUnreferencedDocumentsFunc{
|
|
defaultHook: func(context.Context, int, time.Duration, time.Time) (int, int, error) {
|
|
panic("unexpected invocation of MockLSIFStore.DeleteUnreferencedDocuments")
|
|
},
|
|
},
|
|
IDsWithMetaFunc: &LSIFStoreIDsWithMetaFunc{
|
|
defaultHook: func(context.Context, []int) ([]int, error) {
|
|
panic("unexpected invocation of MockLSIFStore.IDsWithMeta")
|
|
},
|
|
},
|
|
InsertMetadataFunc: &LSIFStoreInsertMetadataFunc{
|
|
defaultHook: func(context.Context, int, lsifstore.ProcessedMetadata) error {
|
|
panic("unexpected invocation of MockLSIFStore.InsertMetadata")
|
|
},
|
|
},
|
|
NewPreciseSCIPWriterFunc: &LSIFStoreNewPreciseSCIPWriterFunc{
|
|
defaultHook: func(context.Context, int) (lsifstore.SCIPWriter, error) {
|
|
panic("unexpected invocation of MockLSIFStore.NewPreciseSCIPWriter")
|
|
},
|
|
},
|
|
NewSyntacticSCIPWriterFunc: &LSIFStoreNewSyntacticSCIPWriterFunc{
|
|
defaultHook: func(int) (lsifstore.SCIPWriter, error) {
|
|
panic("unexpected invocation of MockLSIFStore.NewSyntacticSCIPWriter")
|
|
},
|
|
},
|
|
ReconcileCandidatesFunc: &LSIFStoreReconcileCandidatesFunc{
|
|
defaultHook: func(context.Context, int) ([]int, error) {
|
|
panic("unexpected invocation of MockLSIFStore.ReconcileCandidates")
|
|
},
|
|
},
|
|
ReconcileCandidatesWithTimeFunc: &LSIFStoreReconcileCandidatesWithTimeFunc{
|
|
defaultHook: func(context.Context, int, time.Time) ([]int, error) {
|
|
panic("unexpected invocation of MockLSIFStore.ReconcileCandidatesWithTime")
|
|
},
|
|
},
|
|
WithTransactionFunc: &LSIFStoreWithTransactionFunc{
|
|
defaultHook: func(context.Context, func(s lsifstore.Store) error) error {
|
|
panic("unexpected invocation of MockLSIFStore.WithTransaction")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockLSIFStoreFrom creates a new mock of the MockLSIFStore interface.
|
|
// All methods delegate to the given implementation, unless overwritten.
|
|
func NewMockLSIFStoreFrom(i lsifstore.Store) *MockLSIFStore {
|
|
return &MockLSIFStore{
|
|
DeleteAbandonedSchemaVersionsRecordsFunc: &LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc{
|
|
defaultHook: i.DeleteAbandonedSchemaVersionsRecords,
|
|
},
|
|
DeleteLsifDataByUploadIdsFunc: &LSIFStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: i.DeleteLsifDataByUploadIds,
|
|
},
|
|
DeleteUnreferencedDocumentsFunc: &LSIFStoreDeleteUnreferencedDocumentsFunc{
|
|
defaultHook: i.DeleteUnreferencedDocuments,
|
|
},
|
|
IDsWithMetaFunc: &LSIFStoreIDsWithMetaFunc{
|
|
defaultHook: i.IDsWithMeta,
|
|
},
|
|
InsertMetadataFunc: &LSIFStoreInsertMetadataFunc{
|
|
defaultHook: i.InsertMetadata,
|
|
},
|
|
NewPreciseSCIPWriterFunc: &LSIFStoreNewPreciseSCIPWriterFunc{
|
|
defaultHook: i.NewPreciseSCIPWriter,
|
|
},
|
|
NewSyntacticSCIPWriterFunc: &LSIFStoreNewSyntacticSCIPWriterFunc{
|
|
defaultHook: i.NewSyntacticSCIPWriter,
|
|
},
|
|
ReconcileCandidatesFunc: &LSIFStoreReconcileCandidatesFunc{
|
|
defaultHook: i.ReconcileCandidates,
|
|
},
|
|
ReconcileCandidatesWithTimeFunc: &LSIFStoreReconcileCandidatesWithTimeFunc{
|
|
defaultHook: i.ReconcileCandidatesWithTime,
|
|
},
|
|
WithTransactionFunc: &LSIFStoreWithTransactionFunc{
|
|
defaultHook: i.WithTransaction,
|
|
},
|
|
}
|
|
}
|
|
|
|
// LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc describes the behavior
|
|
// when the DeleteAbandonedSchemaVersionsRecords method of the parent
|
|
// MockLSIFStore instance is invoked.
|
|
type LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc struct {
|
|
defaultHook func(context.Context) (int, error)
|
|
hooks []func(context.Context) (int, error)
|
|
history []LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteAbandonedSchemaVersionsRecords delegates to the next hook function
|
|
// in the queue and stores the parameter and result values of this
|
|
// invocation.
|
|
func (m *MockLSIFStore) DeleteAbandonedSchemaVersionsRecords(v0 context.Context) (int, error) {
|
|
r0, r1 := m.DeleteAbandonedSchemaVersionsRecordsFunc.nextHook()(v0)
|
|
m.DeleteAbandonedSchemaVersionsRecordsFunc.appendCall(LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteAbandonedSchemaVersionsRecords method of the parent MockLSIFStore
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) SetDefaultHook(hook func(context.Context) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteAbandonedSchemaVersionsRecords method of the parent MockLSIFStore
|
|
// 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 *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) 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 *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) 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 *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) 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 *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) appendCall(r0 LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *LSIFStoreDeleteAbandonedSchemaVersionsRecordsFunc) History() []LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall is an object that
|
|
// describes an invocation of method DeleteAbandonedSchemaVersionsRecords on
|
|
// an instance of MockLSIFStore.
|
|
type LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall 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 LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreDeleteAbandonedSchemaVersionsRecordsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreDeleteLsifDataByUploadIdsFunc describes the behavior when the
|
|
// DeleteLsifDataByUploadIds method of the parent MockLSIFStore instance is
|
|
// invoked.
|
|
type LSIFStoreDeleteLsifDataByUploadIdsFunc struct {
|
|
defaultHook func(context.Context, ...int) error
|
|
hooks []func(context.Context, ...int) error
|
|
history []LSIFStoreDeleteLsifDataByUploadIdsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteLsifDataByUploadIds delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) DeleteLsifDataByUploadIds(v0 context.Context, v1 ...int) error {
|
|
r0 := m.DeleteLsifDataByUploadIdsFunc.nextHook()(v0, v1...)
|
|
m.DeleteLsifDataByUploadIdsFunc.appendCall(LSIFStoreDeleteLsifDataByUploadIdsFuncCall{v0, v1, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteLsifDataByUploadIds method of the parent MockLSIFStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *LSIFStoreDeleteLsifDataByUploadIdsFunc) SetDefaultHook(hook func(context.Context, ...int) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteLsifDataByUploadIds method of the parent MockLSIFStore 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 *LSIFStoreDeleteLsifDataByUploadIdsFunc) 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 *LSIFStoreDeleteLsifDataByUploadIdsFunc) 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 *LSIFStoreDeleteLsifDataByUploadIdsFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, ...int) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreDeleteLsifDataByUploadIdsFunc) 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 *LSIFStoreDeleteLsifDataByUploadIdsFunc) appendCall(r0 LSIFStoreDeleteLsifDataByUploadIdsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreDeleteLsifDataByUploadIdsFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LSIFStoreDeleteLsifDataByUploadIdsFunc) History() []LSIFStoreDeleteLsifDataByUploadIdsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreDeleteLsifDataByUploadIdsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreDeleteLsifDataByUploadIdsFuncCall is an object that describes an
|
|
// invocation of method DeleteLsifDataByUploadIds on an instance of
|
|
// MockLSIFStore.
|
|
type LSIFStoreDeleteLsifDataByUploadIdsFuncCall 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 LSIFStoreDeleteLsifDataByUploadIdsFuncCall) 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 LSIFStoreDeleteLsifDataByUploadIdsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// LSIFStoreDeleteUnreferencedDocumentsFunc describes the behavior when the
|
|
// DeleteUnreferencedDocuments method of the parent MockLSIFStore instance
|
|
// is invoked.
|
|
type LSIFStoreDeleteUnreferencedDocumentsFunc 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 []LSIFStoreDeleteUnreferencedDocumentsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteUnreferencedDocuments delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) DeleteUnreferencedDocuments(v0 context.Context, v1 int, v2 time.Duration, v3 time.Time) (int, int, error) {
|
|
r0, r1, r2 := m.DeleteUnreferencedDocumentsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.DeleteUnreferencedDocumentsFunc.appendCall(LSIFStoreDeleteUnreferencedDocumentsFuncCall{v0, v1, v2, v3, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteUnreferencedDocuments method of the parent MockLSIFStore instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *LSIFStoreDeleteUnreferencedDocumentsFunc) 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
|
|
// DeleteUnreferencedDocuments method of the parent MockLSIFStore 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 *LSIFStoreDeleteUnreferencedDocumentsFunc) 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 *LSIFStoreDeleteUnreferencedDocumentsFunc) 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 *LSIFStoreDeleteUnreferencedDocumentsFunc) 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 *LSIFStoreDeleteUnreferencedDocumentsFunc) 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 *LSIFStoreDeleteUnreferencedDocumentsFunc) appendCall(r0 LSIFStoreDeleteUnreferencedDocumentsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// LSIFStoreDeleteUnreferencedDocumentsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *LSIFStoreDeleteUnreferencedDocumentsFunc) History() []LSIFStoreDeleteUnreferencedDocumentsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreDeleteUnreferencedDocumentsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreDeleteUnreferencedDocumentsFuncCall is an object that describes
|
|
// an invocation of method DeleteUnreferencedDocuments on an instance of
|
|
// MockLSIFStore.
|
|
type LSIFStoreDeleteUnreferencedDocumentsFuncCall 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 LSIFStoreDeleteUnreferencedDocumentsFuncCall) 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 LSIFStoreDeleteUnreferencedDocumentsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// LSIFStoreIDsWithMetaFunc describes the behavior when the IDsWithMeta
|
|
// method of the parent MockLSIFStore instance is invoked.
|
|
type LSIFStoreIDsWithMetaFunc struct {
|
|
defaultHook func(context.Context, []int) ([]int, error)
|
|
hooks []func(context.Context, []int) ([]int, error)
|
|
history []LSIFStoreIDsWithMetaFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// IDsWithMeta delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) IDsWithMeta(v0 context.Context, v1 []int) ([]int, error) {
|
|
r0, r1 := m.IDsWithMetaFunc.nextHook()(v0, v1)
|
|
m.IDsWithMetaFunc.appendCall(LSIFStoreIDsWithMetaFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the IDsWithMeta method
|
|
// of the parent MockLSIFStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *LSIFStoreIDsWithMetaFunc) 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
|
|
// IDsWithMeta method of the parent MockLSIFStore 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 *LSIFStoreIDsWithMetaFunc) 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 *LSIFStoreIDsWithMetaFunc) 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 *LSIFStoreIDsWithMetaFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, []int) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreIDsWithMetaFunc) 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 *LSIFStoreIDsWithMetaFunc) appendCall(r0 LSIFStoreIDsWithMetaFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreIDsWithMetaFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LSIFStoreIDsWithMetaFunc) History() []LSIFStoreIDsWithMetaFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreIDsWithMetaFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreIDsWithMetaFuncCall is an object that describes an invocation of
|
|
// method IDsWithMeta on an instance of MockLSIFStore.
|
|
type LSIFStoreIDsWithMetaFuncCall 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 LSIFStoreIDsWithMetaFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreIDsWithMetaFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreInsertMetadataFunc describes the behavior when the
|
|
// InsertMetadata method of the parent MockLSIFStore instance is invoked.
|
|
type LSIFStoreInsertMetadataFunc struct {
|
|
defaultHook func(context.Context, int, lsifstore.ProcessedMetadata) error
|
|
hooks []func(context.Context, int, lsifstore.ProcessedMetadata) error
|
|
history []LSIFStoreInsertMetadataFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// InsertMetadata delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) InsertMetadata(v0 context.Context, v1 int, v2 lsifstore.ProcessedMetadata) error {
|
|
r0 := m.InsertMetadataFunc.nextHook()(v0, v1, v2)
|
|
m.InsertMetadataFunc.appendCall(LSIFStoreInsertMetadataFuncCall{v0, v1, v2, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the InsertMetadata
|
|
// method of the parent MockLSIFStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LSIFStoreInsertMetadataFunc) SetDefaultHook(hook func(context.Context, int, lsifstore.ProcessedMetadata) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// InsertMetadata method of the parent MockLSIFStore 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 *LSIFStoreInsertMetadataFunc) PushHook(hook func(context.Context, int, lsifstore.ProcessedMetadata) 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 *LSIFStoreInsertMetadataFunc) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(context.Context, int, lsifstore.ProcessedMetadata) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LSIFStoreInsertMetadataFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int, lsifstore.ProcessedMetadata) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreInsertMetadataFunc) nextHook() func(context.Context, int, lsifstore.ProcessedMetadata) 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 *LSIFStoreInsertMetadataFunc) appendCall(r0 LSIFStoreInsertMetadataFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreInsertMetadataFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LSIFStoreInsertMetadataFunc) History() []LSIFStoreInsertMetadataFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreInsertMetadataFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreInsertMetadataFuncCall is an object that describes an invocation
|
|
// of method InsertMetadata on an instance of MockLSIFStore.
|
|
type LSIFStoreInsertMetadataFuncCall 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 lsifstore.ProcessedMetadata
|
|
// 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 LSIFStoreInsertMetadataFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreInsertMetadataFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// LSIFStoreNewPreciseSCIPWriterFunc describes the behavior when the
|
|
// NewPreciseSCIPWriter method of the parent MockLSIFStore instance is
|
|
// invoked.
|
|
type LSIFStoreNewPreciseSCIPWriterFunc struct {
|
|
defaultHook func(context.Context, int) (lsifstore.SCIPWriter, error)
|
|
hooks []func(context.Context, int) (lsifstore.SCIPWriter, error)
|
|
history []LSIFStoreNewPreciseSCIPWriterFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// NewPreciseSCIPWriter delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) NewPreciseSCIPWriter(v0 context.Context, v1 int) (lsifstore.SCIPWriter, error) {
|
|
r0, r1 := m.NewPreciseSCIPWriterFunc.nextHook()(v0, v1)
|
|
m.NewPreciseSCIPWriterFunc.appendCall(LSIFStoreNewPreciseSCIPWriterFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the NewPreciseSCIPWriter
|
|
// method of the parent MockLSIFStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LSIFStoreNewPreciseSCIPWriterFunc) SetDefaultHook(hook func(context.Context, int) (lsifstore.SCIPWriter, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// NewPreciseSCIPWriter method of the parent MockLSIFStore 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 *LSIFStoreNewPreciseSCIPWriterFunc) PushHook(hook func(context.Context, int) (lsifstore.SCIPWriter, 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 *LSIFStoreNewPreciseSCIPWriterFunc) SetDefaultReturn(r0 lsifstore.SCIPWriter, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int) (lsifstore.SCIPWriter, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LSIFStoreNewPreciseSCIPWriterFunc) PushReturn(r0 lsifstore.SCIPWriter, r1 error) {
|
|
f.PushHook(func(context.Context, int) (lsifstore.SCIPWriter, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreNewPreciseSCIPWriterFunc) nextHook() func(context.Context, int) (lsifstore.SCIPWriter, 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 *LSIFStoreNewPreciseSCIPWriterFunc) appendCall(r0 LSIFStoreNewPreciseSCIPWriterFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreNewPreciseSCIPWriterFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LSIFStoreNewPreciseSCIPWriterFunc) History() []LSIFStoreNewPreciseSCIPWriterFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreNewPreciseSCIPWriterFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreNewPreciseSCIPWriterFuncCall is an object that describes an
|
|
// invocation of method NewPreciseSCIPWriter on an instance of
|
|
// MockLSIFStore.
|
|
type LSIFStoreNewPreciseSCIPWriterFuncCall 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 lsifstore.SCIPWriter
|
|
// 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 LSIFStoreNewPreciseSCIPWriterFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreNewPreciseSCIPWriterFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreNewSyntacticSCIPWriterFunc describes the behavior when the
|
|
// NewSyntacticSCIPWriter method of the parent MockLSIFStore instance is
|
|
// invoked.
|
|
type LSIFStoreNewSyntacticSCIPWriterFunc struct {
|
|
defaultHook func(int) (lsifstore.SCIPWriter, error)
|
|
hooks []func(int) (lsifstore.SCIPWriter, error)
|
|
history []LSIFStoreNewSyntacticSCIPWriterFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// NewSyntacticSCIPWriter delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) NewSyntacticSCIPWriter(v0 int) (lsifstore.SCIPWriter, error) {
|
|
r0, r1 := m.NewSyntacticSCIPWriterFunc.nextHook()(v0)
|
|
m.NewSyntacticSCIPWriterFunc.appendCall(LSIFStoreNewSyntacticSCIPWriterFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// NewSyntacticSCIPWriter method of the parent MockLSIFStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *LSIFStoreNewSyntacticSCIPWriterFunc) SetDefaultHook(hook func(int) (lsifstore.SCIPWriter, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// NewSyntacticSCIPWriter method of the parent MockLSIFStore 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 *LSIFStoreNewSyntacticSCIPWriterFunc) PushHook(hook func(int) (lsifstore.SCIPWriter, 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 *LSIFStoreNewSyntacticSCIPWriterFunc) SetDefaultReturn(r0 lsifstore.SCIPWriter, r1 error) {
|
|
f.SetDefaultHook(func(int) (lsifstore.SCIPWriter, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LSIFStoreNewSyntacticSCIPWriterFunc) PushReturn(r0 lsifstore.SCIPWriter, r1 error) {
|
|
f.PushHook(func(int) (lsifstore.SCIPWriter, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreNewSyntacticSCIPWriterFunc) nextHook() func(int) (lsifstore.SCIPWriter, 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 *LSIFStoreNewSyntacticSCIPWriterFunc) appendCall(r0 LSIFStoreNewSyntacticSCIPWriterFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreNewSyntacticSCIPWriterFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LSIFStoreNewSyntacticSCIPWriterFunc) History() []LSIFStoreNewSyntacticSCIPWriterFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreNewSyntacticSCIPWriterFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreNewSyntacticSCIPWriterFuncCall is an object that describes an
|
|
// invocation of method NewSyntacticSCIPWriter on an instance of
|
|
// MockLSIFStore.
|
|
type LSIFStoreNewSyntacticSCIPWriterFuncCall struct {
|
|
// Arg0 is the value of the 1st argument passed to this method
|
|
// invocation.
|
|
Arg0 int
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 lsifstore.SCIPWriter
|
|
// 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 LSIFStoreNewSyntacticSCIPWriterFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreNewSyntacticSCIPWriterFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreReconcileCandidatesFunc describes the behavior when the
|
|
// ReconcileCandidates method of the parent MockLSIFStore instance is
|
|
// invoked.
|
|
type LSIFStoreReconcileCandidatesFunc struct {
|
|
defaultHook func(context.Context, int) ([]int, error)
|
|
hooks []func(context.Context, int) ([]int, error)
|
|
history []LSIFStoreReconcileCandidatesFuncCall
|
|
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 *MockLSIFStore) ReconcileCandidates(v0 context.Context, v1 int) ([]int, error) {
|
|
r0, r1 := m.ReconcileCandidatesFunc.nextHook()(v0, v1)
|
|
m.ReconcileCandidatesFunc.appendCall(LSIFStoreReconcileCandidatesFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ReconcileCandidates
|
|
// method of the parent MockLSIFStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LSIFStoreReconcileCandidatesFunc) 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 MockLSIFStore 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 *LSIFStoreReconcileCandidatesFunc) 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 *LSIFStoreReconcileCandidatesFunc) 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 *LSIFStoreReconcileCandidatesFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, int) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreReconcileCandidatesFunc) 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 *LSIFStoreReconcileCandidatesFunc) appendCall(r0 LSIFStoreReconcileCandidatesFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreReconcileCandidatesFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LSIFStoreReconcileCandidatesFunc) History() []LSIFStoreReconcileCandidatesFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreReconcileCandidatesFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreReconcileCandidatesFuncCall is an object that describes an
|
|
// invocation of method ReconcileCandidates on an instance of MockLSIFStore.
|
|
type LSIFStoreReconcileCandidatesFuncCall 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 LSIFStoreReconcileCandidatesFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreReconcileCandidatesFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreReconcileCandidatesWithTimeFunc describes the behavior when the
|
|
// ReconcileCandidatesWithTime method of the parent MockLSIFStore instance
|
|
// is invoked.
|
|
type LSIFStoreReconcileCandidatesWithTimeFunc struct {
|
|
defaultHook func(context.Context, int, time.Time) ([]int, error)
|
|
hooks []func(context.Context, int, time.Time) ([]int, error)
|
|
history []LSIFStoreReconcileCandidatesWithTimeFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ReconcileCandidatesWithTime delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockLSIFStore) ReconcileCandidatesWithTime(v0 context.Context, v1 int, v2 time.Time) ([]int, error) {
|
|
r0, r1 := m.ReconcileCandidatesWithTimeFunc.nextHook()(v0, v1, v2)
|
|
m.ReconcileCandidatesWithTimeFunc.appendCall(LSIFStoreReconcileCandidatesWithTimeFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// ReconcileCandidatesWithTime method of the parent MockLSIFStore instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *LSIFStoreReconcileCandidatesWithTimeFunc) SetDefaultHook(hook func(context.Context, int, time.Time) ([]int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ReconcileCandidatesWithTime method of the parent MockLSIFStore 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 *LSIFStoreReconcileCandidatesWithTimeFunc) PushHook(hook func(context.Context, int, time.Time) ([]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 *LSIFStoreReconcileCandidatesWithTimeFunc) SetDefaultReturn(r0 []int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LSIFStoreReconcileCandidatesWithTimeFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreReconcileCandidatesWithTimeFunc) nextHook() func(context.Context, int, time.Time) ([]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 *LSIFStoreReconcileCandidatesWithTimeFunc) appendCall(r0 LSIFStoreReconcileCandidatesWithTimeFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// LSIFStoreReconcileCandidatesWithTimeFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *LSIFStoreReconcileCandidatesWithTimeFunc) History() []LSIFStoreReconcileCandidatesWithTimeFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreReconcileCandidatesWithTimeFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreReconcileCandidatesWithTimeFuncCall is an object that describes
|
|
// an invocation of method ReconcileCandidatesWithTime on an instance of
|
|
// MockLSIFStore.
|
|
type LSIFStoreReconcileCandidatesWithTimeFuncCall 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.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 error
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c LSIFStoreReconcileCandidatesWithTimeFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreReconcileCandidatesWithTimeFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LSIFStoreWithTransactionFunc describes the behavior when the
|
|
// WithTransaction method of the parent MockLSIFStore instance is invoked.
|
|
type LSIFStoreWithTransactionFunc struct {
|
|
defaultHook func(context.Context, func(s lsifstore.Store) error) error
|
|
hooks []func(context.Context, func(s lsifstore.Store) error) error
|
|
history []LSIFStoreWithTransactionFuncCall
|
|
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 *MockLSIFStore) WithTransaction(v0 context.Context, v1 func(s lsifstore.Store) error) error {
|
|
r0 := m.WithTransactionFunc.nextHook()(v0, v1)
|
|
m.WithTransactionFunc.appendCall(LSIFStoreWithTransactionFuncCall{v0, v1, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WithTransaction
|
|
// method of the parent MockLSIFStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LSIFStoreWithTransactionFunc) SetDefaultHook(hook func(context.Context, func(s lsifstore.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 MockLSIFStore 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 *LSIFStoreWithTransactionFunc) PushHook(hook func(context.Context, func(s lsifstore.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 *LSIFStoreWithTransactionFunc) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(context.Context, func(s lsifstore.Store) error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LSIFStoreWithTransactionFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, func(s lsifstore.Store) error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *LSIFStoreWithTransactionFunc) nextHook() func(context.Context, func(s lsifstore.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 *LSIFStoreWithTransactionFunc) appendCall(r0 LSIFStoreWithTransactionFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LSIFStoreWithTransactionFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LSIFStoreWithTransactionFunc) History() []LSIFStoreWithTransactionFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LSIFStoreWithTransactionFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LSIFStoreWithTransactionFuncCall is an object that describes an
|
|
// invocation of method WithTransaction on an instance of MockLSIFStore.
|
|
type LSIFStoreWithTransactionFuncCall 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 lsifstore.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 LSIFStoreWithTransactionFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LSIFStoreWithTransactionFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// MockPolicyService is a mock implementation of the PolicyService interface
|
|
// (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockPolicyService struct {
|
|
// GetConfigurationPoliciesFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetConfigurationPolicies.
|
|
GetConfigurationPoliciesFunc *PolicyServiceGetConfigurationPoliciesFunc
|
|
}
|
|
|
|
// NewMockPolicyService creates a new mock of the PolicyService interface.
|
|
// All methods return zero values for all results, unless overwritten.
|
|
func NewMockPolicyService() *MockPolicyService {
|
|
return &MockPolicyService{
|
|
GetConfigurationPoliciesFunc: &PolicyServiceGetConfigurationPoliciesFunc{
|
|
defaultHook: func(context.Context, shared1.GetConfigurationPoliciesOptions) (r0 []shared1.ConfigurationPolicy, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockPolicyService creates a new mock of the PolicyService
|
|
// interface. All methods panic on invocation, unless overwritten.
|
|
func NewStrictMockPolicyService() *MockPolicyService {
|
|
return &MockPolicyService{
|
|
GetConfigurationPoliciesFunc: &PolicyServiceGetConfigurationPoliciesFunc{
|
|
defaultHook: func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error) {
|
|
panic("unexpected invocation of MockPolicyService.GetConfigurationPolicies")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockPolicyServiceFrom creates a new mock of the MockPolicyService
|
|
// interface. All methods delegate to the given implementation, unless
|
|
// overwritten.
|
|
func NewMockPolicyServiceFrom(i PolicyService) *MockPolicyService {
|
|
return &MockPolicyService{
|
|
GetConfigurationPoliciesFunc: &PolicyServiceGetConfigurationPoliciesFunc{
|
|
defaultHook: i.GetConfigurationPolicies,
|
|
},
|
|
}
|
|
}
|
|
|
|
// PolicyServiceGetConfigurationPoliciesFunc describes the behavior when the
|
|
// GetConfigurationPolicies method of the parent MockPolicyService instance
|
|
// is invoked.
|
|
type PolicyServiceGetConfigurationPoliciesFunc struct {
|
|
defaultHook func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error)
|
|
hooks []func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error)
|
|
history []PolicyServiceGetConfigurationPoliciesFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetConfigurationPolicies delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockPolicyService) GetConfigurationPolicies(v0 context.Context, v1 shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error) {
|
|
r0, r1, r2 := m.GetConfigurationPoliciesFunc.nextHook()(v0, v1)
|
|
m.GetConfigurationPoliciesFunc.appendCall(PolicyServiceGetConfigurationPoliciesFuncCall{v0, v1, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetConfigurationPolicies method of the parent MockPolicyService instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) SetDefaultHook(hook func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetConfigurationPolicies method of the parent MockPolicyService 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 *PolicyServiceGetConfigurationPoliciesFunc) PushHook(hook func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, 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 *PolicyServiceGetConfigurationPoliciesFunc) SetDefaultReturn(r0 []shared1.ConfigurationPolicy, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) PushReturn(r0 []shared1.ConfigurationPolicy, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) nextHook() func(context.Context, shared1.GetConfigurationPoliciesOptions) ([]shared1.ConfigurationPolicy, 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 *PolicyServiceGetConfigurationPoliciesFunc) appendCall(r0 PolicyServiceGetConfigurationPoliciesFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// PolicyServiceGetConfigurationPoliciesFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) History() []PolicyServiceGetConfigurationPoliciesFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]PolicyServiceGetConfigurationPoliciesFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// PolicyServiceGetConfigurationPoliciesFuncCall is an object that describes
|
|
// an invocation of method GetConfigurationPolicies on an instance of
|
|
// MockPolicyService.
|
|
type PolicyServiceGetConfigurationPoliciesFuncCall 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.GetConfigurationPoliciesOptions
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []shared1.ConfigurationPolicy
|
|
// 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 PolicyServiceGetConfigurationPoliciesFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c PolicyServiceGetConfigurationPoliciesFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// MockWorkerStore is a mock implementation of the Store interface (from the
|
|
// package
|
|
// github.com/sourcegraph/sourcegraph/internal/workerutil/dbworker/store)
|
|
// used for unit testing.
|
|
type MockWorkerStore[T workerutil.Record] struct {
|
|
// AddExecutionLogEntryFunc is an instance of a mock function object
|
|
// controlling the behavior of the method AddExecutionLogEntry.
|
|
AddExecutionLogEntryFunc *WorkerStoreAddExecutionLogEntryFunc[T]
|
|
// DequeueFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Dequeue.
|
|
DequeueFunc *WorkerStoreDequeueFunc[T]
|
|
// HandleFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Handle.
|
|
HandleFunc *WorkerStoreHandleFunc[T]
|
|
// HeartbeatFunc is an instance of a mock function object controlling
|
|
// the behavior of the method Heartbeat.
|
|
HeartbeatFunc *WorkerStoreHeartbeatFunc[T]
|
|
// MarkCompleteFunc is an instance of a mock function object controlling
|
|
// the behavior of the method MarkComplete.
|
|
MarkCompleteFunc *WorkerStoreMarkCompleteFunc[T]
|
|
// MarkErroredFunc is an instance of a mock function object controlling
|
|
// the behavior of the method MarkErrored.
|
|
MarkErroredFunc *WorkerStoreMarkErroredFunc[T]
|
|
// MarkFailedFunc is an instance of a mock function object controlling
|
|
// the behavior of the method MarkFailed.
|
|
MarkFailedFunc *WorkerStoreMarkFailedFunc[T]
|
|
// MaxDurationInQueueFunc is an instance of a mock function object
|
|
// controlling the behavior of the method MaxDurationInQueue.
|
|
MaxDurationInQueueFunc *WorkerStoreMaxDurationInQueueFunc[T]
|
|
// QueuedCountFunc is an instance of a mock function object controlling
|
|
// the behavior of the method QueuedCount.
|
|
QueuedCountFunc *WorkerStoreQueuedCountFunc[T]
|
|
// RequeueFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Requeue.
|
|
RequeueFunc *WorkerStoreRequeueFunc[T]
|
|
// ResetStalledFunc is an instance of a mock function object controlling
|
|
// the behavior of the method ResetStalled.
|
|
ResetStalledFunc *WorkerStoreResetStalledFunc[T]
|
|
// UpdateExecutionLogEntryFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateExecutionLogEntry.
|
|
UpdateExecutionLogEntryFunc *WorkerStoreUpdateExecutionLogEntryFunc[T]
|
|
// WithFunc is an instance of a mock function object controlling the
|
|
// behavior of the method With.
|
|
WithFunc *WorkerStoreWithFunc[T]
|
|
}
|
|
|
|
// NewMockWorkerStore creates a new mock of the Store interface. All methods
|
|
// return zero values for all results, unless overwritten.
|
|
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) {
|
|
return
|
|
},
|
|
},
|
|
DequeueFunc: &WorkerStoreDequeueFunc[T]{
|
|
defaultHook: func(context.Context, string, []*sqlf.Query) (r0 T, r1 bool, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
HandleFunc: &WorkerStoreHandleFunc[T]{
|
|
defaultHook: func() (r0 basestore.TransactableHandle) {
|
|
return
|
|
},
|
|
},
|
|
HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{
|
|
defaultHook: func(context.Context, []string, store1.HeartbeatOptions) (r0 []string, r1 []string, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{
|
|
defaultHook: func(context.Context, int, store1.MarkFinalOptions) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{
|
|
defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{
|
|
defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
MaxDurationInQueueFunc: &WorkerStoreMaxDurationInQueueFunc[T]{
|
|
defaultHook: func(context.Context) (r0 time.Duration, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
QueuedCountFunc: &WorkerStoreQueuedCountFunc[T]{
|
|
defaultHook: func(context.Context, bool) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RequeueFunc: &WorkerStoreRequeueFunc[T]{
|
|
defaultHook: func(context.Context, int, time.Time) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
ResetStalledFunc: &WorkerStoreResetStalledFunc[T]{
|
|
defaultHook: func(context.Context) (r0 map[int]time.Duration, r1 map[int]time.Duration, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{
|
|
defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
WithFunc: &WorkerStoreWithFunc[T]{
|
|
defaultHook: func(basestore.ShareableStore) (r0 store1.Store[T]) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockWorkerStore creates a new mock of the Store interface. All
|
|
// methods panic on invocation, unless overwritten.
|
|
func NewStrictMockWorkerStore[T workerutil.Record]() *MockWorkerStore[T] {
|
|
return &MockWorkerStore[T]{
|
|
AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{
|
|
defaultHook: func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (int, error) {
|
|
panic("unexpected invocation of MockWorkerStore.AddExecutionLogEntry")
|
|
},
|
|
},
|
|
DequeueFunc: &WorkerStoreDequeueFunc[T]{
|
|
defaultHook: func(context.Context, string, []*sqlf.Query) (T, bool, error) {
|
|
panic("unexpected invocation of MockWorkerStore.Dequeue")
|
|
},
|
|
},
|
|
HandleFunc: &WorkerStoreHandleFunc[T]{
|
|
defaultHook: func() basestore.TransactableHandle {
|
|
panic("unexpected invocation of MockWorkerStore.Handle")
|
|
},
|
|
},
|
|
HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{
|
|
defaultHook: func(context.Context, []string, store1.HeartbeatOptions) ([]string, []string, error) {
|
|
panic("unexpected invocation of MockWorkerStore.Heartbeat")
|
|
},
|
|
},
|
|
MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{
|
|
defaultHook: func(context.Context, int, store1.MarkFinalOptions) (bool, error) {
|
|
panic("unexpected invocation of MockWorkerStore.MarkComplete")
|
|
},
|
|
},
|
|
MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{
|
|
defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) {
|
|
panic("unexpected invocation of MockWorkerStore.MarkErrored")
|
|
},
|
|
},
|
|
MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{
|
|
defaultHook: func(context.Context, int, string, store1.MarkFinalOptions) (bool, error) {
|
|
panic("unexpected invocation of MockWorkerStore.MarkFailed")
|
|
},
|
|
},
|
|
MaxDurationInQueueFunc: &WorkerStoreMaxDurationInQueueFunc[T]{
|
|
defaultHook: func(context.Context) (time.Duration, error) {
|
|
panic("unexpected invocation of MockWorkerStore.MaxDurationInQueue")
|
|
},
|
|
},
|
|
QueuedCountFunc: &WorkerStoreQueuedCountFunc[T]{
|
|
defaultHook: func(context.Context, bool) (int, error) {
|
|
panic("unexpected invocation of MockWorkerStore.QueuedCount")
|
|
},
|
|
},
|
|
RequeueFunc: &WorkerStoreRequeueFunc[T]{
|
|
defaultHook: func(context.Context, int, time.Time) error {
|
|
panic("unexpected invocation of MockWorkerStore.Requeue")
|
|
},
|
|
},
|
|
ResetStalledFunc: &WorkerStoreResetStalledFunc[T]{
|
|
defaultHook: func(context.Context) (map[int]time.Duration, map[int]time.Duration, error) {
|
|
panic("unexpected invocation of MockWorkerStore.ResetStalled")
|
|
},
|
|
},
|
|
UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{
|
|
defaultHook: func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) error {
|
|
panic("unexpected invocation of MockWorkerStore.UpdateExecutionLogEntry")
|
|
},
|
|
},
|
|
WithFunc: &WorkerStoreWithFunc[T]{
|
|
defaultHook: func(basestore.ShareableStore) store1.Store[T] {
|
|
panic("unexpected invocation of MockWorkerStore.With")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// 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] {
|
|
return &MockWorkerStore[T]{
|
|
AddExecutionLogEntryFunc: &WorkerStoreAddExecutionLogEntryFunc[T]{
|
|
defaultHook: i.AddExecutionLogEntry,
|
|
},
|
|
DequeueFunc: &WorkerStoreDequeueFunc[T]{
|
|
defaultHook: i.Dequeue,
|
|
},
|
|
HandleFunc: &WorkerStoreHandleFunc[T]{
|
|
defaultHook: i.Handle,
|
|
},
|
|
HeartbeatFunc: &WorkerStoreHeartbeatFunc[T]{
|
|
defaultHook: i.Heartbeat,
|
|
},
|
|
MarkCompleteFunc: &WorkerStoreMarkCompleteFunc[T]{
|
|
defaultHook: i.MarkComplete,
|
|
},
|
|
MarkErroredFunc: &WorkerStoreMarkErroredFunc[T]{
|
|
defaultHook: i.MarkErrored,
|
|
},
|
|
MarkFailedFunc: &WorkerStoreMarkFailedFunc[T]{
|
|
defaultHook: i.MarkFailed,
|
|
},
|
|
MaxDurationInQueueFunc: &WorkerStoreMaxDurationInQueueFunc[T]{
|
|
defaultHook: i.MaxDurationInQueue,
|
|
},
|
|
QueuedCountFunc: &WorkerStoreQueuedCountFunc[T]{
|
|
defaultHook: i.QueuedCount,
|
|
},
|
|
RequeueFunc: &WorkerStoreRequeueFunc[T]{
|
|
defaultHook: i.Requeue,
|
|
},
|
|
ResetStalledFunc: &WorkerStoreResetStalledFunc[T]{
|
|
defaultHook: i.ResetStalled,
|
|
},
|
|
UpdateExecutionLogEntryFunc: &WorkerStoreUpdateExecutionLogEntryFunc[T]{
|
|
defaultHook: i.UpdateExecutionLogEntry,
|
|
},
|
|
WithFunc: &WorkerStoreWithFunc[T]{
|
|
defaultHook: i.With,
|
|
},
|
|
}
|
|
}
|
|
|
|
// WorkerStoreAddExecutionLogEntryFunc describes the behavior when the
|
|
// 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)
|
|
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) {
|
|
r0, r1 := m.AddExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3)
|
|
m.AddExecutionLogEntryFunc.appendCall(WorkerStoreAddExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// AddExecutionLogEntry 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 *WorkerStoreAddExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (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 *WorkerStoreAddExecutionLogEntryFunc[T]) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, executor.ExecutionLogEntry, store1.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) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreAddExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) (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 *WorkerStoreAddExecutionLogEntryFunc[T]) appendCall(r0 WorkerStoreAddExecutionLogEntryFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreAddExecutionLogEntryFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *WorkerStoreAddExecutionLogEntryFunc[T]) History() []WorkerStoreAddExecutionLogEntryFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreAddExecutionLogEntryFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreAddExecutionLogEntryFuncCall is an object that describes an
|
|
// invocation of method AddExecutionLogEntry on an instance of
|
|
// MockWorkerStore.
|
|
type WorkerStoreAddExecutionLogEntryFuncCall[T workerutil.Record] 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 executor.ExecutionLogEntry
|
|
// Arg3 is the value of the 4th argument passed to this method
|
|
// invocation.
|
|
Arg3 store1.ExecutionLogEntryOptions
|
|
// 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 WorkerStoreAddExecutionLogEntryFuncCall[T]) 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 WorkerStoreAddExecutionLogEntryFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// WorkerStoreDequeueFunc describes the behavior when the Dequeue method of
|
|
// the parent MockWorkerStore instance is invoked.
|
|
type WorkerStoreDequeueFunc[T workerutil.Record] struct {
|
|
defaultHook func(context.Context, string, []*sqlf.Query) (T, bool, error)
|
|
hooks []func(context.Context, string, []*sqlf.Query) (T, bool, error)
|
|
history []WorkerStoreDequeueFuncCall[T]
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Dequeue delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockWorkerStore[T]) Dequeue(v0 context.Context, v1 string, v2 []*sqlf.Query) (T, bool, error) {
|
|
r0, r1, r2 := m.DequeueFunc.nextHook()(v0, v1, v2)
|
|
m.DequeueFunc.appendCall(WorkerStoreDequeueFuncCall[T]{v0, v1, v2, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Dequeue method of
|
|
// the parent MockWorkerStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *WorkerStoreDequeueFunc[T]) SetDefaultHook(hook func(context.Context, string, []*sqlf.Query) (T, bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Dequeue 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 *WorkerStoreDequeueFunc[T]) PushHook(hook func(context.Context, string, []*sqlf.Query) (T, 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 *WorkerStoreDequeueFunc[T]) SetDefaultReturn(r0 T, r1 bool, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, string, []*sqlf.Query) (T, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *WorkerStoreDequeueFunc[T]) PushReturn(r0 T, r1 bool, r2 error) {
|
|
f.PushHook(func(context.Context, string, []*sqlf.Query) (T, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreDequeueFunc[T]) nextHook() func(context.Context, string, []*sqlf.Query) (T, 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 *WorkerStoreDequeueFunc[T]) appendCall(r0 WorkerStoreDequeueFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreDequeueFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreDequeueFunc[T]) History() []WorkerStoreDequeueFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreDequeueFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreDequeueFuncCall is an object that describes an invocation of
|
|
// method Dequeue on an instance of MockWorkerStore.
|
|
type WorkerStoreDequeueFuncCall[T workerutil.Record] 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 string
|
|
// Arg2 is the value of the 3rd argument passed to this method
|
|
// invocation.
|
|
Arg2 []*sqlf.Query
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 T
|
|
// 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 WorkerStoreDequeueFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreDequeueFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// WorkerStoreHandleFunc describes the behavior when the Handle method of
|
|
// the parent MockWorkerStore instance is invoked.
|
|
type WorkerStoreHandleFunc[T workerutil.Record] struct {
|
|
defaultHook func() basestore.TransactableHandle
|
|
hooks []func() basestore.TransactableHandle
|
|
history []WorkerStoreHandleFuncCall[T]
|
|
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 *MockWorkerStore[T]) Handle() basestore.TransactableHandle {
|
|
r0 := m.HandleFunc.nextHook()()
|
|
m.HandleFunc.appendCall(WorkerStoreHandleFuncCall[T]{r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Handle method of the
|
|
// parent MockWorkerStore instance is invoked and the hook queue is empty.
|
|
func (f *WorkerStoreHandleFunc[T]) SetDefaultHook(hook func() basestore.TransactableHandle) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Handle 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 *WorkerStoreHandleFunc[T]) PushHook(hook func() basestore.TransactableHandle) {
|
|
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 *WorkerStoreHandleFunc[T]) SetDefaultReturn(r0 basestore.TransactableHandle) {
|
|
f.SetDefaultHook(func() basestore.TransactableHandle {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *WorkerStoreHandleFunc[T]) PushReturn(r0 basestore.TransactableHandle) {
|
|
f.PushHook(func() basestore.TransactableHandle {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreHandleFunc[T]) nextHook() func() basestore.TransactableHandle {
|
|
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 *WorkerStoreHandleFunc[T]) appendCall(r0 WorkerStoreHandleFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreHandleFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreHandleFunc[T]) History() []WorkerStoreHandleFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreHandleFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreHandleFuncCall is an object that describes an invocation of
|
|
// method Handle on an instance of MockWorkerStore.
|
|
type WorkerStoreHandleFuncCall[T workerutil.Record] struct {
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 basestore.TransactableHandle
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c WorkerStoreHandleFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreHandleFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// 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)
|
|
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) {
|
|
r0, r1, r2 := m.HeartbeatFunc.nextHook()(v0, v1, v2)
|
|
m.HeartbeatFunc.appendCall(WorkerStoreHeartbeatFuncCall[T]{v0, v1, v2, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// 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)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// 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)) {
|
|
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 *WorkerStoreHeartbeatFunc[T]) SetDefaultReturn(r0 []string, r1 []string, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, []string, store1.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) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreHeartbeatFunc[T]) nextHook() func(context.Context, []string, store1.HeartbeatOptions) ([]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 *WorkerStoreHeartbeatFunc[T]) appendCall(r0 WorkerStoreHeartbeatFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreHeartbeatFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreHeartbeatFunc[T]) History() []WorkerStoreHeartbeatFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreHeartbeatFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreHeartbeatFuncCall is an object that describes an invocation of
|
|
// method Heartbeat on an instance of MockWorkerStore.
|
|
type WorkerStoreHeartbeatFuncCall[T workerutil.Record] 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 []string
|
|
// Arg2 is the value of the 3rd argument passed to this method
|
|
// invocation.
|
|
Arg2 store1.HeartbeatOptions
|
|
// 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 WorkerStoreHeartbeatFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreHeartbeatFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// 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)
|
|
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) {
|
|
r0, r1 := m.MarkCompleteFunc.nextHook()(v0, v1, v2)
|
|
m.MarkCompleteFunc.appendCall(WorkerStoreMarkCompleteFuncCall[T]{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// 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)) {
|
|
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 *WorkerStoreMarkCompleteFunc[T]) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, store1.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) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreMarkCompleteFunc[T]) nextHook() func(context.Context, int, store1.MarkFinalOptions) (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 *WorkerStoreMarkCompleteFunc[T]) appendCall(r0 WorkerStoreMarkCompleteFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreMarkCompleteFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreMarkCompleteFunc[T]) History() []WorkerStoreMarkCompleteFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreMarkCompleteFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreMarkCompleteFuncCall is an object that describes an invocation
|
|
// of method MarkComplete on an instance of MockWorkerStore.
|
|
type WorkerStoreMarkCompleteFuncCall[T workerutil.Record] 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 store1.MarkFinalOptions
|
|
// 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 WorkerStoreMarkCompleteFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreMarkCompleteFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// 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)
|
|
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) {
|
|
r0, r1 := m.MarkErroredFunc.nextHook()(v0, v1, v2, v3)
|
|
m.MarkErroredFunc.appendCall(WorkerStoreMarkErroredFuncCall[T]{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// 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)) {
|
|
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 *WorkerStoreMarkErroredFunc[T]) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, store1.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) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreMarkErroredFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (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 *WorkerStoreMarkErroredFunc[T]) appendCall(r0 WorkerStoreMarkErroredFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreMarkErroredFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreMarkErroredFunc[T]) History() []WorkerStoreMarkErroredFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreMarkErroredFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreMarkErroredFuncCall is an object that describes an invocation
|
|
// of method MarkErrored on an instance of MockWorkerStore.
|
|
type WorkerStoreMarkErroredFuncCall[T workerutil.Record] 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 store1.MarkFinalOptions
|
|
// 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 WorkerStoreMarkErroredFuncCall[T]) 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 WorkerStoreMarkErroredFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// 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)
|
|
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) {
|
|
r0, r1 := m.MarkFailedFunc.nextHook()(v0, v1, v2, v3)
|
|
m.MarkFailedFunc.appendCall(WorkerStoreMarkFailedFuncCall[T]{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// 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)) {
|
|
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 *WorkerStoreMarkFailedFunc[T]) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, store1.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) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreMarkFailedFunc[T]) nextHook() func(context.Context, int, string, store1.MarkFinalOptions) (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 *WorkerStoreMarkFailedFunc[T]) appendCall(r0 WorkerStoreMarkFailedFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreMarkFailedFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreMarkFailedFunc[T]) History() []WorkerStoreMarkFailedFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreMarkFailedFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreMarkFailedFuncCall is an object that describes an invocation
|
|
// of method MarkFailed on an instance of MockWorkerStore.
|
|
type WorkerStoreMarkFailedFuncCall[T workerutil.Record] 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 store1.MarkFinalOptions
|
|
// 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 WorkerStoreMarkFailedFuncCall[T]) 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 WorkerStoreMarkFailedFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// WorkerStoreMaxDurationInQueueFunc describes the behavior when the
|
|
// MaxDurationInQueue method of the parent MockWorkerStore instance is
|
|
// invoked.
|
|
type WorkerStoreMaxDurationInQueueFunc[T workerutil.Record] struct {
|
|
defaultHook func(context.Context) (time.Duration, error)
|
|
hooks []func(context.Context) (time.Duration, error)
|
|
history []WorkerStoreMaxDurationInQueueFuncCall[T]
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// MaxDurationInQueue delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockWorkerStore[T]) MaxDurationInQueue(v0 context.Context) (time.Duration, error) {
|
|
r0, r1 := m.MaxDurationInQueueFunc.nextHook()(v0)
|
|
m.MaxDurationInQueueFunc.appendCall(WorkerStoreMaxDurationInQueueFuncCall[T]{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the MaxDurationInQueue
|
|
// method of the parent MockWorkerStore instance is invoked and the hook
|
|
// queue is empty.
|
|
func (f *WorkerStoreMaxDurationInQueueFunc[T]) 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
|
|
// MaxDurationInQueue 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 *WorkerStoreMaxDurationInQueueFunc[T]) 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 *WorkerStoreMaxDurationInQueueFunc[T]) 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 *WorkerStoreMaxDurationInQueueFunc[T]) PushReturn(r0 time.Duration, r1 error) {
|
|
f.PushHook(func(context.Context) (time.Duration, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreMaxDurationInQueueFunc[T]) 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 *WorkerStoreMaxDurationInQueueFunc[T]) appendCall(r0 WorkerStoreMaxDurationInQueueFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreMaxDurationInQueueFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *WorkerStoreMaxDurationInQueueFunc[T]) History() []WorkerStoreMaxDurationInQueueFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreMaxDurationInQueueFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreMaxDurationInQueueFuncCall is an object that describes an
|
|
// invocation of method MaxDurationInQueue on an instance of
|
|
// MockWorkerStore.
|
|
type WorkerStoreMaxDurationInQueueFuncCall[T workerutil.Record] 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 WorkerStoreMaxDurationInQueueFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreMaxDurationInQueueFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// WorkerStoreQueuedCountFunc describes the behavior when the QueuedCount
|
|
// method of the parent MockWorkerStore instance is invoked.
|
|
type WorkerStoreQueuedCountFunc[T workerutil.Record] struct {
|
|
defaultHook func(context.Context, bool) (int, error)
|
|
hooks []func(context.Context, bool) (int, error)
|
|
history []WorkerStoreQueuedCountFuncCall[T]
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// QueuedCount delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockWorkerStore[T]) QueuedCount(v0 context.Context, v1 bool) (int, error) {
|
|
r0, r1 := m.QueuedCountFunc.nextHook()(v0, v1)
|
|
m.QueuedCountFunc.appendCall(WorkerStoreQueuedCountFuncCall[T]{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the QueuedCount method
|
|
// of the parent MockWorkerStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *WorkerStoreQueuedCountFunc[T]) SetDefaultHook(hook func(context.Context, bool) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// QueuedCount 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 *WorkerStoreQueuedCountFunc[T]) PushHook(hook func(context.Context, bool) (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 *WorkerStoreQueuedCountFunc[T]) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, bool) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *WorkerStoreQueuedCountFunc[T]) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, bool) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreQueuedCountFunc[T]) nextHook() func(context.Context, bool) (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 *WorkerStoreQueuedCountFunc[T]) appendCall(r0 WorkerStoreQueuedCountFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreQueuedCountFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreQueuedCountFunc[T]) History() []WorkerStoreQueuedCountFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreQueuedCountFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreQueuedCountFuncCall is an object that describes an invocation
|
|
// of method QueuedCount on an instance of MockWorkerStore.
|
|
type WorkerStoreQueuedCountFuncCall[T workerutil.Record] 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 bool
|
|
// 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 WorkerStoreQueuedCountFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreQueuedCountFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// WorkerStoreRequeueFunc describes the behavior when the Requeue method of
|
|
// the parent MockWorkerStore instance is invoked.
|
|
type WorkerStoreRequeueFunc[T workerutil.Record] struct {
|
|
defaultHook func(context.Context, int, time.Time) error
|
|
hooks []func(context.Context, int, time.Time) error
|
|
history []WorkerStoreRequeueFuncCall[T]
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Requeue delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockWorkerStore[T]) Requeue(v0 context.Context, v1 int, v2 time.Time) error {
|
|
r0 := m.RequeueFunc.nextHook()(v0, v1, v2)
|
|
m.RequeueFunc.appendCall(WorkerStoreRequeueFuncCall[T]{v0, v1, v2, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Requeue method of
|
|
// the parent MockWorkerStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *WorkerStoreRequeueFunc[T]) 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
|
|
// Requeue 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 *WorkerStoreRequeueFunc[T]) 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 *WorkerStoreRequeueFunc[T]) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(context.Context, int, time.Time) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *WorkerStoreRequeueFunc[T]) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int, time.Time) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreRequeueFunc[T]) 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 *WorkerStoreRequeueFunc[T]) appendCall(r0 WorkerStoreRequeueFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreRequeueFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreRequeueFunc[T]) History() []WorkerStoreRequeueFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreRequeueFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreRequeueFuncCall is an object that describes an invocation of
|
|
// method Requeue on an instance of MockWorkerStore.
|
|
type WorkerStoreRequeueFuncCall[T workerutil.Record] 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.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 WorkerStoreRequeueFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreRequeueFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// WorkerStoreResetStalledFunc describes the behavior when the ResetStalled
|
|
// method of the parent MockWorkerStore instance is invoked.
|
|
type WorkerStoreResetStalledFunc[T workerutil.Record] struct {
|
|
defaultHook func(context.Context) (map[int]time.Duration, map[int]time.Duration, error)
|
|
hooks []func(context.Context) (map[int]time.Duration, map[int]time.Duration, error)
|
|
history []WorkerStoreResetStalledFuncCall[T]
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ResetStalled delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockWorkerStore[T]) ResetStalled(v0 context.Context) (map[int]time.Duration, map[int]time.Duration, error) {
|
|
r0, r1, r2 := m.ResetStalledFunc.nextHook()(v0)
|
|
m.ResetStalledFunc.appendCall(WorkerStoreResetStalledFuncCall[T]{v0, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ResetStalled method
|
|
// of the parent MockWorkerStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *WorkerStoreResetStalledFunc[T]) SetDefaultHook(hook func(context.Context) (map[int]time.Duration, map[int]time.Duration, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ResetStalled 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 *WorkerStoreResetStalledFunc[T]) PushHook(hook func(context.Context) (map[int]time.Duration, map[int]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 *WorkerStoreResetStalledFunc[T]) SetDefaultReturn(r0 map[int]time.Duration, r1 map[int]time.Duration, r2 error) {
|
|
f.SetDefaultHook(func(context.Context) (map[int]time.Duration, map[int]time.Duration, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *WorkerStoreResetStalledFunc[T]) PushReturn(r0 map[int]time.Duration, r1 map[int]time.Duration, r2 error) {
|
|
f.PushHook(func(context.Context) (map[int]time.Duration, map[int]time.Duration, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreResetStalledFunc[T]) nextHook() func(context.Context) (map[int]time.Duration, map[int]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 *WorkerStoreResetStalledFunc[T]) appendCall(r0 WorkerStoreResetStalledFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreResetStalledFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *WorkerStoreResetStalledFunc[T]) History() []WorkerStoreResetStalledFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreResetStalledFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreResetStalledFuncCall is an object that describes an invocation
|
|
// of method ResetStalled on an instance of MockWorkerStore.
|
|
type WorkerStoreResetStalledFuncCall[T workerutil.Record] 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 map[int]time.Duration
|
|
// Result1 is the value of the 2nd result returned from this method
|
|
// invocation.
|
|
Result1 map[int]time.Duration
|
|
// 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 WorkerStoreResetStalledFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreResetStalledFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// WorkerStoreUpdateExecutionLogEntryFunc describes the behavior when the
|
|
// 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
|
|
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 {
|
|
r0 := m.UpdateExecutionLogEntryFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.UpdateExecutionLogEntryFunc.appendCall(WorkerStoreUpdateExecutionLogEntryFuncCall[T]{v0, v1, v2, v3, v4, r0})
|
|
return r0
|
|
}
|
|
|
|
// 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) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// UpdateExecutionLogEntry 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 *WorkerStoreUpdateExecutionLogEntryFunc[T]) PushHook(hook func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) 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 *WorkerStoreUpdateExecutionLogEntryFunc[T]) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(context.Context, int, int, executor.ExecutionLogEntry, store1.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 {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) nextHook() func(context.Context, int, int, executor.ExecutionLogEntry, store1.ExecutionLogEntryOptions) 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 *WorkerStoreUpdateExecutionLogEntryFunc[T]) appendCall(r0 WorkerStoreUpdateExecutionLogEntryFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreUpdateExecutionLogEntryFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *WorkerStoreUpdateExecutionLogEntryFunc[T]) History() []WorkerStoreUpdateExecutionLogEntryFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreUpdateExecutionLogEntryFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreUpdateExecutionLogEntryFuncCall is an object that describes an
|
|
// invocation of method UpdateExecutionLogEntry on an instance of
|
|
// MockWorkerStore.
|
|
type WorkerStoreUpdateExecutionLogEntryFuncCall[T workerutil.Record] 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 executor.ExecutionLogEntry
|
|
// Arg4 is the value of the 5th argument passed to this method
|
|
// invocation.
|
|
Arg4 store1.ExecutionLogEntryOptions
|
|
// 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 WorkerStoreUpdateExecutionLogEntryFuncCall[T]) 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 WorkerStoreUpdateExecutionLogEntryFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// 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]
|
|
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] {
|
|
r0 := m.WithFunc.nextHook()(v0)
|
|
m.WithFunc.appendCall(WorkerStoreWithFuncCall[T]{v0, r0})
|
|
return r0
|
|
}
|
|
|
|
// 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]) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// 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]) {
|
|
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 *WorkerStoreWithFunc[T]) SetDefaultReturn(r0 store1.Store[T]) {
|
|
f.SetDefaultHook(func(basestore.ShareableStore) store1.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] {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *WorkerStoreWithFunc[T]) nextHook() func(basestore.ShareableStore) store1.Store[T] {
|
|
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 *WorkerStoreWithFunc[T]) appendCall(r0 WorkerStoreWithFuncCall[T]) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of WorkerStoreWithFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *WorkerStoreWithFunc[T]) History() []WorkerStoreWithFuncCall[T] {
|
|
f.mutex.Lock()
|
|
history := make([]WorkerStoreWithFuncCall[T], len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// WorkerStoreWithFuncCall is an object that describes an invocation of
|
|
// method With on an instance of MockWorkerStore.
|
|
type WorkerStoreWithFuncCall[T workerutil.Record] struct {
|
|
// Arg0 is the value of the 1st argument passed to this method
|
|
// invocation.
|
|
Arg0 basestore.ShareableStore
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 store1.Store[T]
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c WorkerStoreWithFuncCall[T]) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c WorkerStoreWithFuncCall[T]) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|