mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:51:50 +00:00
13211 lines
484 KiB
Go
13211 lines
484 KiB
Go
// Code generated by go-mockgen 1.3.4; 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"
|
|
"io"
|
|
"sync"
|
|
"time"
|
|
|
|
regexp "github.com/grafana/regexp"
|
|
api "github.com/sourcegraph/sourcegraph/internal/api"
|
|
authz "github.com/sourcegraph/sourcegraph/internal/authz"
|
|
shared1 "github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/shared"
|
|
enterprise "github.com/sourcegraph/sourcegraph/internal/codeintel/policies/enterprise"
|
|
shared2 "github.com/sourcegraph/sourcegraph/internal/codeintel/policies/shared"
|
|
types "github.com/sourcegraph/sourcegraph/internal/codeintel/shared/types"
|
|
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"
|
|
gitserver "github.com/sourcegraph/sourcegraph/internal/gitserver"
|
|
gitdomain "github.com/sourcegraph/sourcegraph/internal/gitserver/gitdomain"
|
|
protocol "github.com/sourcegraph/sourcegraph/internal/gitserver/protocol"
|
|
observation "github.com/sourcegraph/sourcegraph/internal/observation"
|
|
types1 "github.com/sourcegraph/sourcegraph/internal/types"
|
|
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
|
|
// BackfillReferenceCountBatchFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// BackfillReferenceCountBatch.
|
|
BackfillReferenceCountBatchFunc *StoreBackfillReferenceCountBatchFunc
|
|
// DeleteOldAuditLogsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteOldAuditLogs.
|
|
DeleteOldAuditLogsFunc *StoreDeleteOldAuditLogsFunc
|
|
// DeleteOverlappingDumpsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteOverlappingDumps.
|
|
DeleteOverlappingDumpsFunc *StoreDeleteOverlappingDumpsFunc
|
|
// DeleteSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteSourcedCommits.
|
|
DeleteSourcedCommitsFunc *StoreDeleteSourcedCommitsFunc
|
|
// 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
|
|
// DoneFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Done.
|
|
DoneFunc *StoreDoneFunc
|
|
// FindClosestDumpsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method FindClosestDumps.
|
|
FindClosestDumpsFunc *StoreFindClosestDumpsFunc
|
|
// FindClosestDumpsFromGraphFragmentFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// FindClosestDumpsFromGraphFragment.
|
|
FindClosestDumpsFromGraphFragmentFunc *StoreFindClosestDumpsFromGraphFragmentFunc
|
|
// GetAuditLogsForUploadFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetAuditLogsForUpload.
|
|
GetAuditLogsForUploadFunc *StoreGetAuditLogsForUploadFunc
|
|
// 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
|
|
// GetDirtyRepositoriesFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetDirtyRepositories.
|
|
GetDirtyRepositoriesFunc *StoreGetDirtyRepositoriesFunc
|
|
// GetDumpsByIDsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetDumpsByIDs.
|
|
GetDumpsByIDsFunc *StoreGetDumpsByIDsFunc
|
|
// GetDumpsWithDefinitionsForMonikersFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// GetDumpsWithDefinitionsForMonikers.
|
|
GetDumpsWithDefinitionsForMonikersFunc *StoreGetDumpsWithDefinitionsForMonikersFunc
|
|
// GetLastUploadRetentionScanForRepositoryFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// GetLastUploadRetentionScanForRepository.
|
|
GetLastUploadRetentionScanForRepositoryFunc *StoreGetLastUploadRetentionScanForRepositoryFunc
|
|
// GetOldestCommitDateFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetOldestCommitDate.
|
|
GetOldestCommitDateFunc *StoreGetOldestCommitDateFunc
|
|
// GetRecentUploadsSummaryFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetRecentUploadsSummary.
|
|
GetRecentUploadsSummaryFunc *StoreGetRecentUploadsSummaryFunc
|
|
// GetRepositoriesForIndexScanFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// GetRepositoriesForIndexScan.
|
|
GetRepositoriesForIndexScanFunc *StoreGetRepositoriesForIndexScanFunc
|
|
// GetRepositoriesMaxStaleAgeFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// GetRepositoriesMaxStaleAge.
|
|
GetRepositoriesMaxStaleAgeFunc *StoreGetRepositoriesMaxStaleAgeFunc
|
|
// GetStaleSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetStaleSourcedCommits.
|
|
GetStaleSourcedCommitsFunc *StoreGetStaleSourcedCommitsFunc
|
|
// 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
|
|
// GetVisibleUploadsMatchingMonikersFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// GetVisibleUploadsMatchingMonikers.
|
|
GetVisibleUploadsMatchingMonikersFunc *StoreGetVisibleUploadsMatchingMonikersFunc
|
|
// 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
|
|
// ReferencesForUploadFunc is an instance of a mock function object
|
|
// controlling the behavior of the method ReferencesForUpload.
|
|
ReferencesForUploadFunc *StoreReferencesForUploadFunc
|
|
// RepoNameFunc is an instance of a mock function object controlling the
|
|
// behavior of the method RepoName.
|
|
RepoNameFunc *StoreRepoNameFunc
|
|
// RepoNamesFunc is an instance of a mock function object controlling
|
|
// the behavior of the method RepoNames.
|
|
RepoNamesFunc *StoreRepoNamesFunc
|
|
// SetRepositoriesForRetentionScanFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// SetRepositoriesForRetentionScan.
|
|
SetRepositoriesForRetentionScanFunc *StoreSetRepositoriesForRetentionScanFunc
|
|
// SetRepositoriesForRetentionScanWithTimeFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// SetRepositoriesForRetentionScanWithTime.
|
|
SetRepositoriesForRetentionScanWithTimeFunc *StoreSetRepositoriesForRetentionScanWithTimeFunc
|
|
// SetRepositoryAsDirtyFunc is an instance of a mock function object
|
|
// controlling the behavior of the method SetRepositoryAsDirty.
|
|
SetRepositoryAsDirtyFunc *StoreSetRepositoryAsDirtyFunc
|
|
// SoftDeleteExpiredUploadsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method SoftDeleteExpiredUploads.
|
|
SoftDeleteExpiredUploadsFunc *StoreSoftDeleteExpiredUploadsFunc
|
|
// SourcedCommitsWithoutCommittedAtFunc is an instance of a mock
|
|
// function object controlling the behavior of the method
|
|
// SourcedCommitsWithoutCommittedAt.
|
|
SourcedCommitsWithoutCommittedAtFunc *StoreSourcedCommitsWithoutCommittedAtFunc
|
|
// TransactFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Transact.
|
|
TransactFunc *StoreTransactFunc
|
|
// 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
|
|
// UpdateSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateSourcedCommits.
|
|
UpdateSourcedCommitsFunc *StoreUpdateSourcedCommitsFunc
|
|
// UpdateUploadRetentionFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateUploadRetention.
|
|
UpdateUploadRetentionFunc *StoreUpdateUploadRetentionFunc
|
|
// UpdateUploadsReferenceCountsFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// UpdateUploadsReferenceCounts.
|
|
UpdateUploadsReferenceCountsFunc *StoreUpdateUploadsReferenceCountsFunc
|
|
// UpdateUploadsVisibleToCommitsFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// UpdateUploadsVisibleToCommits.
|
|
UpdateUploadsVisibleToCommitsFunc *StoreUpdateUploadsVisibleToCommitsFunc
|
|
// 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
|
|
},
|
|
},
|
|
BackfillReferenceCountBatchFunc: &StoreBackfillReferenceCountBatchFunc{
|
|
defaultHook: func(context.Context, int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{
|
|
defaultHook: func(context.Context, time.Duration, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteOverlappingDumpsFunc: &StoreDeleteOverlappingDumpsFunc{
|
|
defaultHook: func(context.Context, int, string, string, string) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &StoreDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (r0 int, r1 int, r2 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 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (r0 map[int]int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DoneFunc: &StoreDoneFunc{
|
|
defaultHook: func(error) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
FindClosestDumpsFunc: &StoreFindClosestDumpsFunc{
|
|
defaultHook: func(context.Context, int, string, string, bool, string) (r0 []types.Dump, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
FindClosestDumpsFromGraphFragmentFunc: &StoreFindClosestDumpsFromGraphFragmentFunc{
|
|
defaultHook: func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) (r0 []types.Dump, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{
|
|
defaultHook: func(context.Context, int) (r0 []types.UploadLog, 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
|
|
},
|
|
},
|
|
GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{
|
|
defaultHook: func(context.Context) (r0 map[int]int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetDumpsByIDsFunc: &StoreGetDumpsByIDsFunc{
|
|
defaultHook: func(context.Context, []int) (r0 []types.Dump, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetDumpsWithDefinitionsForMonikersFunc: &StoreGetDumpsWithDefinitionsForMonikersFunc{
|
|
defaultHook: func(context.Context, []precise.QualifiedMonikerData) (r0 []types.Dump, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{
|
|
defaultHook: func(context.Context, int) (r0 *time.Time, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetOldestCommitDateFunc: &StoreGetOldestCommitDateFunc{
|
|
defaultHook: func(context.Context, int) (r0 time.Time, r1 bool, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{
|
|
defaultHook: func(context.Context, int) (r0 []shared.UploadsWithRepositoryNamespace, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetRepositoriesForIndexScanFunc: &StoreGetRepositoriesForIndexScanFunc{
|
|
defaultHook: func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{
|
|
defaultHook: func(context.Context) (r0 time.Duration, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &StoreGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) (r0 []shared.SourcedCommits, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetUploadByIDFunc: &StoreGetUploadByIDFunc{
|
|
defaultHook: func(context.Context, int) (r0 types.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 []types.Upload, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{
|
|
defaultHook: func(context.Context, ...int) (r0 []types.Upload, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{
|
|
defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (r0 shared.PackageReferenceScanner, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{
|
|
defaultHook: func(context.Context, ...int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
HasCommitFunc: &StoreHasCommitFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
HasRepositoryFunc: &StoreHasRepositoryFunc{
|
|
defaultHook: func(context.Context, int) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
InsertDependencySyncingJobFunc: &StoreInsertDependencySyncingJobFunc{
|
|
defaultHook: func(context.Context, int) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
InsertUploadFunc: &StoreInsertUploadFunc{
|
|
defaultHook: func(context.Context, types.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
|
|
},
|
|
},
|
|
ReferencesForUploadFunc: &StoreReferencesForUploadFunc{
|
|
defaultHook: func(context.Context, int) (r0 shared.PackageReferenceScanner, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RepoNameFunc: &StoreRepoNameFunc{
|
|
defaultHook: func(context.Context, int) (r0 string, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RepoNamesFunc: &StoreRepoNamesFunc{
|
|
defaultHook: func(context.Context, ...int) (r0 map[int]string, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: func(context.Context, time.Duration, int) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanWithTimeFunc: &StoreSetRepositoriesForRetentionScanWithTimeFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{
|
|
defaultHook: func(context.Context, int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{
|
|
defaultHook: func(context.Context, int) (r0 []shared.SourcedCommits, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
TransactFunc: &StoreTransactFunc{
|
|
defaultHook: func(context.Context) (r0 store.Store, 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
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &StoreUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{
|
|
defaultHook: func(context.Context, []int, []int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateUploadsReferenceCountsFunc: &StoreUpdateUploadsReferenceCountsFunc{
|
|
defaultHook: func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{
|
|
defaultHook: func(context.Context, int, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, time.Duration, time.Duration, int, time.Time) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{
|
|
defaultHook: func(*observation.Context) (r0 store1.Store) {
|
|
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")
|
|
},
|
|
},
|
|
BackfillReferenceCountBatchFunc: &StoreBackfillReferenceCountBatchFunc{
|
|
defaultHook: func(context.Context, int) error {
|
|
panic("unexpected invocation of MockStore.BackfillReferenceCountBatch")
|
|
},
|
|
},
|
|
DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{
|
|
defaultHook: func(context.Context, time.Duration, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockStore.DeleteOldAuditLogs")
|
|
},
|
|
},
|
|
DeleteOverlappingDumpsFunc: &StoreDeleteOverlappingDumpsFunc{
|
|
defaultHook: func(context.Context, int, string, string, string) error {
|
|
panic("unexpected invocation of MockStore.DeleteOverlappingDumps")
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &StoreDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
panic("unexpected invocation of MockStore.DeleteSourcedCommits")
|
|
},
|
|
},
|
|
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, error) {
|
|
panic("unexpected invocation of MockStore.DeleteUploadsStuckUploading")
|
|
},
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (map[int]int, error) {
|
|
panic("unexpected invocation of MockStore.DeleteUploadsWithoutRepository")
|
|
},
|
|
},
|
|
DoneFunc: &StoreDoneFunc{
|
|
defaultHook: func(error) error {
|
|
panic("unexpected invocation of MockStore.Done")
|
|
},
|
|
},
|
|
FindClosestDumpsFunc: &StoreFindClosestDumpsFunc{
|
|
defaultHook: func(context.Context, int, string, string, bool, string) ([]types.Dump, error) {
|
|
panic("unexpected invocation of MockStore.FindClosestDumps")
|
|
},
|
|
},
|
|
FindClosestDumpsFromGraphFragmentFunc: &StoreFindClosestDumpsFromGraphFragmentFunc{
|
|
defaultHook: func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error) {
|
|
panic("unexpected invocation of MockStore.FindClosestDumpsFromGraphFragment")
|
|
},
|
|
},
|
|
GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{
|
|
defaultHook: func(context.Context, int) ([]types.UploadLog, error) {
|
|
panic("unexpected invocation of MockStore.GetAuditLogsForUpload")
|
|
},
|
|
},
|
|
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")
|
|
},
|
|
},
|
|
GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{
|
|
defaultHook: func(context.Context) (map[int]int, error) {
|
|
panic("unexpected invocation of MockStore.GetDirtyRepositories")
|
|
},
|
|
},
|
|
GetDumpsByIDsFunc: &StoreGetDumpsByIDsFunc{
|
|
defaultHook: func(context.Context, []int) ([]types.Dump, error) {
|
|
panic("unexpected invocation of MockStore.GetDumpsByIDs")
|
|
},
|
|
},
|
|
GetDumpsWithDefinitionsForMonikersFunc: &StoreGetDumpsWithDefinitionsForMonikersFunc{
|
|
defaultHook: func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error) {
|
|
panic("unexpected invocation of MockStore.GetDumpsWithDefinitionsForMonikers")
|
|
},
|
|
},
|
|
GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{
|
|
defaultHook: func(context.Context, int) (*time.Time, error) {
|
|
panic("unexpected invocation of MockStore.GetLastUploadRetentionScanForRepository")
|
|
},
|
|
},
|
|
GetOldestCommitDateFunc: &StoreGetOldestCommitDateFunc{
|
|
defaultHook: func(context.Context, int) (time.Time, bool, error) {
|
|
panic("unexpected invocation of MockStore.GetOldestCommitDate")
|
|
},
|
|
},
|
|
GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{
|
|
defaultHook: func(context.Context, int) ([]shared.UploadsWithRepositoryNamespace, error) {
|
|
panic("unexpected invocation of MockStore.GetRecentUploadsSummary")
|
|
},
|
|
},
|
|
GetRepositoriesForIndexScanFunc: &StoreGetRepositoriesForIndexScanFunc{
|
|
defaultHook: func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error) {
|
|
panic("unexpected invocation of MockStore.GetRepositoriesForIndexScan")
|
|
},
|
|
},
|
|
GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{
|
|
defaultHook: func(context.Context) (time.Duration, error) {
|
|
panic("unexpected invocation of MockStore.GetRepositoriesMaxStaleAge")
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &StoreGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
panic("unexpected invocation of MockStore.GetStaleSourcedCommits")
|
|
},
|
|
},
|
|
GetUploadByIDFunc: &StoreGetUploadByIDFunc{
|
|
defaultHook: func(context.Context, int) (types.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) ([]types.Upload, int, error) {
|
|
panic("unexpected invocation of MockStore.GetUploads")
|
|
},
|
|
},
|
|
GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{
|
|
defaultHook: func(context.Context, ...int) ([]types.Upload, error) {
|
|
panic("unexpected invocation of MockStore.GetUploadsByIDs")
|
|
},
|
|
},
|
|
GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{
|
|
defaultHook: func(context.Context, int, string, []precise.QualifiedMonikerData, int, int) (shared.PackageReferenceScanner, int, error) {
|
|
panic("unexpected invocation of MockStore.GetVisibleUploadsMatchingMonikers")
|
|
},
|
|
},
|
|
HardDeleteUploadsByIDsFunc: &StoreHardDeleteUploadsByIDsFunc{
|
|
defaultHook: func(context.Context, ...int) error {
|
|
panic("unexpected invocation of MockStore.HardDeleteUploadsByIDs")
|
|
},
|
|
},
|
|
HasCommitFunc: &StoreHasCommitFunc{
|
|
defaultHook: func(context.Context, int, string) (bool, error) {
|
|
panic("unexpected invocation of MockStore.HasCommit")
|
|
},
|
|
},
|
|
HasRepositoryFunc: &StoreHasRepositoryFunc{
|
|
defaultHook: func(context.Context, int) (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, types.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")
|
|
},
|
|
},
|
|
ReferencesForUploadFunc: &StoreReferencesForUploadFunc{
|
|
defaultHook: func(context.Context, int) (shared.PackageReferenceScanner, error) {
|
|
panic("unexpected invocation of MockStore.ReferencesForUpload")
|
|
},
|
|
},
|
|
RepoNameFunc: &StoreRepoNameFunc{
|
|
defaultHook: func(context.Context, int) (string, error) {
|
|
panic("unexpected invocation of MockStore.RepoName")
|
|
},
|
|
},
|
|
RepoNamesFunc: &StoreRepoNamesFunc{
|
|
defaultHook: func(context.Context, ...int) (map[int]string, error) {
|
|
panic("unexpected invocation of MockStore.RepoNames")
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: func(context.Context, time.Duration, int) ([]int, error) {
|
|
panic("unexpected invocation of MockStore.SetRepositoriesForRetentionScan")
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanWithTimeFunc: &StoreSetRepositoriesForRetentionScanWithTimeFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) ([]int, error) {
|
|
panic("unexpected invocation of MockStore.SetRepositoriesForRetentionScanWithTime")
|
|
},
|
|
},
|
|
SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{
|
|
defaultHook: func(context.Context, int) error {
|
|
panic("unexpected invocation of MockStore.SetRepositoryAsDirty")
|
|
},
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (int, error) {
|
|
panic("unexpected invocation of MockStore.SoftDeleteExpiredUploads")
|
|
},
|
|
},
|
|
SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{
|
|
defaultHook: func(context.Context, int) ([]shared.SourcedCommits, error) {
|
|
panic("unexpected invocation of MockStore.SourcedCommitsWithoutCommittedAt")
|
|
},
|
|
},
|
|
TransactFunc: &StoreTransactFunc{
|
|
defaultHook: func(context.Context) (store.Store, error) {
|
|
panic("unexpected invocation of MockStore.Transact")
|
|
},
|
|
},
|
|
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")
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &StoreUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockStore.UpdateSourcedCommits")
|
|
},
|
|
},
|
|
UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{
|
|
defaultHook: func(context.Context, []int, []int) error {
|
|
panic("unexpected invocation of MockStore.UpdateUploadRetention")
|
|
},
|
|
},
|
|
UpdateUploadsReferenceCountsFunc: &StoreUpdateUploadsReferenceCountsFunc{
|
|
defaultHook: func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error) {
|
|
panic("unexpected invocation of MockStore.UpdateUploadsReferenceCounts")
|
|
},
|
|
},
|
|
UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{
|
|
defaultHook: func(context.Context, int, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, time.Duration, time.Duration, int, time.Time) error {
|
|
panic("unexpected invocation of MockStore.UpdateUploadsVisibleToCommits")
|
|
},
|
|
},
|
|
WorkerutilStoreFunc: &StoreWorkerutilStoreFunc{
|
|
defaultHook: func(*observation.Context) store1.Store {
|
|
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,
|
|
},
|
|
BackfillReferenceCountBatchFunc: &StoreBackfillReferenceCountBatchFunc{
|
|
defaultHook: i.BackfillReferenceCountBatch,
|
|
},
|
|
DeleteOldAuditLogsFunc: &StoreDeleteOldAuditLogsFunc{
|
|
defaultHook: i.DeleteOldAuditLogs,
|
|
},
|
|
DeleteOverlappingDumpsFunc: &StoreDeleteOverlappingDumpsFunc{
|
|
defaultHook: i.DeleteOverlappingDumps,
|
|
},
|
|
DeleteSourcedCommitsFunc: &StoreDeleteSourcedCommitsFunc{
|
|
defaultHook: i.DeleteSourcedCommits,
|
|
},
|
|
DeleteUploadByIDFunc: &StoreDeleteUploadByIDFunc{
|
|
defaultHook: i.DeleteUploadByID,
|
|
},
|
|
DeleteUploadsFunc: &StoreDeleteUploadsFunc{
|
|
defaultHook: i.DeleteUploads,
|
|
},
|
|
DeleteUploadsStuckUploadingFunc: &StoreDeleteUploadsStuckUploadingFunc{
|
|
defaultHook: i.DeleteUploadsStuckUploading,
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &StoreDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: i.DeleteUploadsWithoutRepository,
|
|
},
|
|
DoneFunc: &StoreDoneFunc{
|
|
defaultHook: i.Done,
|
|
},
|
|
FindClosestDumpsFunc: &StoreFindClosestDumpsFunc{
|
|
defaultHook: i.FindClosestDumps,
|
|
},
|
|
FindClosestDumpsFromGraphFragmentFunc: &StoreFindClosestDumpsFromGraphFragmentFunc{
|
|
defaultHook: i.FindClosestDumpsFromGraphFragment,
|
|
},
|
|
GetAuditLogsForUploadFunc: &StoreGetAuditLogsForUploadFunc{
|
|
defaultHook: i.GetAuditLogsForUpload,
|
|
},
|
|
GetCommitGraphMetadataFunc: &StoreGetCommitGraphMetadataFunc{
|
|
defaultHook: i.GetCommitGraphMetadata,
|
|
},
|
|
GetCommitsVisibleToUploadFunc: &StoreGetCommitsVisibleToUploadFunc{
|
|
defaultHook: i.GetCommitsVisibleToUpload,
|
|
},
|
|
GetDirtyRepositoriesFunc: &StoreGetDirtyRepositoriesFunc{
|
|
defaultHook: i.GetDirtyRepositories,
|
|
},
|
|
GetDumpsByIDsFunc: &StoreGetDumpsByIDsFunc{
|
|
defaultHook: i.GetDumpsByIDs,
|
|
},
|
|
GetDumpsWithDefinitionsForMonikersFunc: &StoreGetDumpsWithDefinitionsForMonikersFunc{
|
|
defaultHook: i.GetDumpsWithDefinitionsForMonikers,
|
|
},
|
|
GetLastUploadRetentionScanForRepositoryFunc: &StoreGetLastUploadRetentionScanForRepositoryFunc{
|
|
defaultHook: i.GetLastUploadRetentionScanForRepository,
|
|
},
|
|
GetOldestCommitDateFunc: &StoreGetOldestCommitDateFunc{
|
|
defaultHook: i.GetOldestCommitDate,
|
|
},
|
|
GetRecentUploadsSummaryFunc: &StoreGetRecentUploadsSummaryFunc{
|
|
defaultHook: i.GetRecentUploadsSummary,
|
|
},
|
|
GetRepositoriesForIndexScanFunc: &StoreGetRepositoriesForIndexScanFunc{
|
|
defaultHook: i.GetRepositoriesForIndexScan,
|
|
},
|
|
GetRepositoriesMaxStaleAgeFunc: &StoreGetRepositoriesMaxStaleAgeFunc{
|
|
defaultHook: i.GetRepositoriesMaxStaleAge,
|
|
},
|
|
GetStaleSourcedCommitsFunc: &StoreGetStaleSourcedCommitsFunc{
|
|
defaultHook: i.GetStaleSourcedCommits,
|
|
},
|
|
GetUploadByIDFunc: &StoreGetUploadByIDFunc{
|
|
defaultHook: i.GetUploadByID,
|
|
},
|
|
GetUploadIDsWithReferencesFunc: &StoreGetUploadIDsWithReferencesFunc{
|
|
defaultHook: i.GetUploadIDsWithReferences,
|
|
},
|
|
GetUploadsFunc: &StoreGetUploadsFunc{
|
|
defaultHook: i.GetUploads,
|
|
},
|
|
GetUploadsByIDsFunc: &StoreGetUploadsByIDsFunc{
|
|
defaultHook: i.GetUploadsByIDs,
|
|
},
|
|
GetVisibleUploadsMatchingMonikersFunc: &StoreGetVisibleUploadsMatchingMonikersFunc{
|
|
defaultHook: i.GetVisibleUploadsMatchingMonikers,
|
|
},
|
|
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,
|
|
},
|
|
ReferencesForUploadFunc: &StoreReferencesForUploadFunc{
|
|
defaultHook: i.ReferencesForUpload,
|
|
},
|
|
RepoNameFunc: &StoreRepoNameFunc{
|
|
defaultHook: i.RepoName,
|
|
},
|
|
RepoNamesFunc: &StoreRepoNamesFunc{
|
|
defaultHook: i.RepoNames,
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &StoreSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: i.SetRepositoriesForRetentionScan,
|
|
},
|
|
SetRepositoriesForRetentionScanWithTimeFunc: &StoreSetRepositoriesForRetentionScanWithTimeFunc{
|
|
defaultHook: i.SetRepositoriesForRetentionScanWithTime,
|
|
},
|
|
SetRepositoryAsDirtyFunc: &StoreSetRepositoryAsDirtyFunc{
|
|
defaultHook: i.SetRepositoryAsDirty,
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &StoreSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: i.SoftDeleteExpiredUploads,
|
|
},
|
|
SourcedCommitsWithoutCommittedAtFunc: &StoreSourcedCommitsWithoutCommittedAtFunc{
|
|
defaultHook: i.SourcedCommitsWithoutCommittedAt,
|
|
},
|
|
TransactFunc: &StoreTransactFunc{
|
|
defaultHook: i.Transact,
|
|
},
|
|
UpdateCommittedAtFunc: &StoreUpdateCommittedAtFunc{
|
|
defaultHook: i.UpdateCommittedAt,
|
|
},
|
|
UpdatePackageReferencesFunc: &StoreUpdatePackageReferencesFunc{
|
|
defaultHook: i.UpdatePackageReferences,
|
|
},
|
|
UpdatePackagesFunc: &StoreUpdatePackagesFunc{
|
|
defaultHook: i.UpdatePackages,
|
|
},
|
|
UpdateSourcedCommitsFunc: &StoreUpdateSourcedCommitsFunc{
|
|
defaultHook: i.UpdateSourcedCommits,
|
|
},
|
|
UpdateUploadRetentionFunc: &StoreUpdateUploadRetentionFunc{
|
|
defaultHook: i.UpdateUploadRetention,
|
|
},
|
|
UpdateUploadsReferenceCountsFunc: &StoreUpdateUploadsReferenceCountsFunc{
|
|
defaultHook: i.UpdateUploadsReferenceCounts,
|
|
},
|
|
UpdateUploadsVisibleToCommitsFunc: &StoreUpdateUploadsVisibleToCommitsFunc{
|
|
defaultHook: i.UpdateUploadsVisibleToCommits,
|
|
},
|
|
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}
|
|
}
|
|
|
|
// StoreBackfillReferenceCountBatchFunc describes the behavior when the
|
|
// BackfillReferenceCountBatch method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreBackfillReferenceCountBatchFunc struct {
|
|
defaultHook func(context.Context, int) error
|
|
hooks []func(context.Context, int) error
|
|
history []StoreBackfillReferenceCountBatchFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// BackfillReferenceCountBatch delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) BackfillReferenceCountBatch(v0 context.Context, v1 int) error {
|
|
r0 := m.BackfillReferenceCountBatchFunc.nextHook()(v0, v1)
|
|
m.BackfillReferenceCountBatchFunc.appendCall(StoreBackfillReferenceCountBatchFuncCall{v0, v1, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// BackfillReferenceCountBatch method of the parent MockStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *StoreBackfillReferenceCountBatchFunc) SetDefaultHook(hook func(context.Context, int) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// BackfillReferenceCountBatch 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 *StoreBackfillReferenceCountBatchFunc) 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 *StoreBackfillReferenceCountBatchFunc) 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 *StoreBackfillReferenceCountBatchFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *StoreBackfillReferenceCountBatchFunc) 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 *StoreBackfillReferenceCountBatchFunc) appendCall(r0 StoreBackfillReferenceCountBatchFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreBackfillReferenceCountBatchFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *StoreBackfillReferenceCountBatchFunc) History() []StoreBackfillReferenceCountBatchFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreBackfillReferenceCountBatchFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreBackfillReferenceCountBatchFuncCall is an object that describes an
|
|
// invocation of method BackfillReferenceCountBatch on an instance of
|
|
// MockStore.
|
|
type StoreBackfillReferenceCountBatchFuncCall 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 StoreBackfillReferenceCountBatchFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreBackfillReferenceCountBatchFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// 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, error)
|
|
hooks []func(context.Context, time.Duration, time.Time) (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, error) {
|
|
r0, r1 := m.DeleteOldAuditLogsFunc.nextHook()(v0, v1, v2)
|
|
m.DeleteOldAuditLogsFunc.appendCall(StoreDeleteOldAuditLogsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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, 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, 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 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreDeleteOldAuditLogsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreDeleteOldAuditLogsFunc) nextHook() func(context.Context, time.Duration, 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 *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 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}
|
|
}
|
|
|
|
// StoreDeleteOverlappingDumpsFunc describes the behavior when the
|
|
// DeleteOverlappingDumps method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreDeleteOverlappingDumpsFunc struct {
|
|
defaultHook func(context.Context, int, string, string, string) error
|
|
hooks []func(context.Context, int, string, string, string) error
|
|
history []StoreDeleteOverlappingDumpsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteOverlappingDumps delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) DeleteOverlappingDumps(v0 context.Context, v1 int, v2 string, v3 string, v4 string) error {
|
|
r0 := m.DeleteOverlappingDumpsFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.DeleteOverlappingDumpsFunc.appendCall(StoreDeleteOverlappingDumpsFuncCall{v0, v1, v2, v3, v4, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteOverlappingDumps method of the parent MockStore instance is invoked
|
|
// and the hook queue is empty.
|
|
func (f *StoreDeleteOverlappingDumpsFunc) 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
|
|
// DeleteOverlappingDumps 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 *StoreDeleteOverlappingDumpsFunc) 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 *StoreDeleteOverlappingDumpsFunc) 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 *StoreDeleteOverlappingDumpsFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int, string, string, string) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *StoreDeleteOverlappingDumpsFunc) 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 *StoreDeleteOverlappingDumpsFunc) appendCall(r0 StoreDeleteOverlappingDumpsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreDeleteOverlappingDumpsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreDeleteOverlappingDumpsFunc) History() []StoreDeleteOverlappingDumpsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreDeleteOverlappingDumpsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreDeleteOverlappingDumpsFuncCall is an object that describes an
|
|
// invocation of method DeleteOverlappingDumps on an instance of MockStore.
|
|
type StoreDeleteOverlappingDumpsFuncCall 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 StoreDeleteOverlappingDumpsFuncCall) 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 StoreDeleteOverlappingDumpsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// StoreDeleteSourcedCommitsFunc describes the behavior when the
|
|
// DeleteSourcedCommits method of the parent MockStore instance is invoked.
|
|
type StoreDeleteSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Duration, time.Time) (int, int, error)
|
|
hooks []func(context.Context, int, string, time.Duration, time.Time) (int, int, error)
|
|
history []StoreDeleteSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockStore) DeleteSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Duration, v4 time.Time) (int, int, error) {
|
|
r0, r1, r2 := m.DeleteSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.DeleteSourcedCommitsFunc.appendCall(StoreDeleteSourcedCommitsFuncCall{v0, v1, v2, v3, v4, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the DeleteSourcedCommits
|
|
// method of the parent MockStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *StoreDeleteSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Duration, time.Time) (int, int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteSourcedCommits 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 *StoreDeleteSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, 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 *StoreDeleteSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreDeleteSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *StoreDeleteSourcedCommitsFunc) nextHook() func(context.Context, int, string, 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 *StoreDeleteSourcedCommitsFunc) appendCall(r0 StoreDeleteSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreDeleteSourcedCommitsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreDeleteSourcedCommitsFunc) History() []StoreDeleteSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreDeleteSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreDeleteSourcedCommitsFuncCall is an object that describes an
|
|
// invocation of method DeleteSourcedCommits on an instance of MockStore.
|
|
type StoreDeleteSourcedCommitsFuncCall 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 time.Duration
|
|
// Arg4 is the value of the 5th argument passed to this method
|
|
// invocation.
|
|
Arg4 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 StoreDeleteSourcedCommitsFuncCall) 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 StoreDeleteSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// 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, error)
|
|
hooks []func(context.Context, time.Time) (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, error) {
|
|
r0, r1 := m.DeleteUploadsStuckUploadingFunc.nextHook()(v0, v1)
|
|
m.DeleteUploadsStuckUploadingFunc.appendCall(StoreDeleteUploadsStuckUploadingFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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, 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, 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 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreDeleteUploadsStuckUploadingFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreDeleteUploadsStuckUploadingFunc) nextHook() func(context.Context, 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 *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 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}
|
|
}
|
|
|
|
// StoreDeleteUploadsWithoutRepositoryFunc describes the behavior when the
|
|
// DeleteUploadsWithoutRepository method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreDeleteUploadsWithoutRepositoryFunc struct {
|
|
defaultHook func(context.Context, time.Time) (map[int]int, error)
|
|
hooks []func(context.Context, time.Time) (map[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) (map[int]int, error) {
|
|
r0, r1 := m.DeleteUploadsWithoutRepositoryFunc.nextHook()(v0, v1)
|
|
m.DeleteUploadsWithoutRepositoryFunc.appendCall(StoreDeleteUploadsWithoutRepositoryFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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) (map[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) (map[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 map[int]int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreDeleteUploadsWithoutRepositoryFunc) PushReturn(r0 map[int]int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreDeleteUploadsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (map[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 map[int]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 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}
|
|
}
|
|
|
|
// StoreDoneFunc describes the behavior when the Done method of the parent
|
|
// MockStore instance is invoked.
|
|
type StoreDoneFunc struct {
|
|
defaultHook func(error) error
|
|
hooks []func(error) error
|
|
history []StoreDoneFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Done delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockStore) Done(v0 error) error {
|
|
r0 := m.DoneFunc.nextHook()(v0)
|
|
m.DoneFunc.appendCall(StoreDoneFuncCall{v0, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Done method of the
|
|
// parent MockStore instance is invoked and the hook queue is empty.
|
|
func (f *StoreDoneFunc) SetDefaultHook(hook func(error) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Done 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 *StoreDoneFunc) PushHook(hook func(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 *StoreDoneFunc) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreDoneFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *StoreDoneFunc) nextHook() func(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 *StoreDoneFunc) appendCall(r0 StoreDoneFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreDoneFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *StoreDoneFunc) History() []StoreDoneFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreDoneFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreDoneFuncCall is an object that describes an invocation of method
|
|
// Done on an instance of MockStore.
|
|
type StoreDoneFuncCall struct {
|
|
// Arg0 is the value of the 1st argument passed to this method
|
|
// invocation.
|
|
Arg0 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 StoreDoneFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreDoneFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// StoreFindClosestDumpsFunc describes the behavior when the
|
|
// FindClosestDumps method of the parent MockStore instance is invoked.
|
|
type StoreFindClosestDumpsFunc struct {
|
|
defaultHook func(context.Context, int, string, string, bool, string) ([]types.Dump, error)
|
|
hooks []func(context.Context, int, string, string, bool, string) ([]types.Dump, error)
|
|
history []StoreFindClosestDumpsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// FindClosestDumps delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockStore) FindClosestDumps(v0 context.Context, v1 int, v2 string, v3 string, v4 bool, v5 string) ([]types.Dump, error) {
|
|
r0, r1 := m.FindClosestDumpsFunc.nextHook()(v0, v1, v2, v3, v4, v5)
|
|
m.FindClosestDumpsFunc.appendCall(StoreFindClosestDumpsFuncCall{v0, v1, v2, v3, v4, v5, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the FindClosestDumps
|
|
// method of the parent MockStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *StoreFindClosestDumpsFunc) SetDefaultHook(hook func(context.Context, int, string, string, bool, string) ([]types.Dump, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// FindClosestDumps 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 *StoreFindClosestDumpsFunc) PushHook(hook func(context.Context, int, string, string, bool, string) ([]types.Dump, 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 *StoreFindClosestDumpsFunc) SetDefaultReturn(r0 []types.Dump, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, string, bool, string) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreFindClosestDumpsFunc) PushReturn(r0 []types.Dump, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, string, bool, string) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreFindClosestDumpsFunc) nextHook() func(context.Context, int, string, string, bool, string) ([]types.Dump, 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 *StoreFindClosestDumpsFunc) appendCall(r0 StoreFindClosestDumpsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreFindClosestDumpsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreFindClosestDumpsFunc) History() []StoreFindClosestDumpsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreFindClosestDumpsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreFindClosestDumpsFuncCall is an object that describes an invocation
|
|
// of method FindClosestDumps on an instance of MockStore.
|
|
type StoreFindClosestDumpsFuncCall 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 bool
|
|
// Arg5 is the value of the 6th argument passed to this method
|
|
// invocation.
|
|
Arg5 string
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []types.Dump
|
|
// 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 StoreFindClosestDumpsFuncCall) 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 StoreFindClosestDumpsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// StoreFindClosestDumpsFromGraphFragmentFunc describes the behavior when
|
|
// the FindClosestDumpsFromGraphFragment method of the parent MockStore
|
|
// instance is invoked.
|
|
type StoreFindClosestDumpsFromGraphFragmentFunc struct {
|
|
defaultHook func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error)
|
|
hooks []func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error)
|
|
history []StoreFindClosestDumpsFromGraphFragmentFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// FindClosestDumpsFromGraphFragment delegates to the next hook function in
|
|
// the queue and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) FindClosestDumpsFromGraphFragment(v0 context.Context, v1 int, v2 string, v3 string, v4 bool, v5 string, v6 *gitdomain.CommitGraph) ([]types.Dump, error) {
|
|
r0, r1 := m.FindClosestDumpsFromGraphFragmentFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6)
|
|
m.FindClosestDumpsFromGraphFragmentFunc.appendCall(StoreFindClosestDumpsFromGraphFragmentFuncCall{v0, v1, v2, v3, v4, v5, v6, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// FindClosestDumpsFromGraphFragment method of the parent MockStore instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *StoreFindClosestDumpsFromGraphFragmentFunc) SetDefaultHook(hook func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// FindClosestDumpsFromGraphFragment 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 *StoreFindClosestDumpsFromGraphFragmentFunc) PushHook(hook func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, 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 *StoreFindClosestDumpsFromGraphFragmentFunc) SetDefaultReturn(r0 []types.Dump, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreFindClosestDumpsFromGraphFragmentFunc) PushReturn(r0 []types.Dump, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreFindClosestDumpsFromGraphFragmentFunc) nextHook() func(context.Context, int, string, string, bool, string, *gitdomain.CommitGraph) ([]types.Dump, 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 *StoreFindClosestDumpsFromGraphFragmentFunc) appendCall(r0 StoreFindClosestDumpsFromGraphFragmentFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// StoreFindClosestDumpsFromGraphFragmentFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *StoreFindClosestDumpsFromGraphFragmentFunc) History() []StoreFindClosestDumpsFromGraphFragmentFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreFindClosestDumpsFromGraphFragmentFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreFindClosestDumpsFromGraphFragmentFuncCall is an object that
|
|
// describes an invocation of method FindClosestDumpsFromGraphFragment on an
|
|
// instance of MockStore.
|
|
type StoreFindClosestDumpsFromGraphFragmentFuncCall 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 bool
|
|
// Arg5 is the value of the 6th argument passed to this method
|
|
// invocation.
|
|
Arg5 string
|
|
// Arg6 is the value of the 7th argument passed to this method
|
|
// invocation.
|
|
Arg6 *gitdomain.CommitGraph
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []types.Dump
|
|
// 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 StoreFindClosestDumpsFromGraphFragmentFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4, c.Arg5, c.Arg6}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreFindClosestDumpsFromGraphFragmentFuncCall) 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) ([]types.UploadLog, error)
|
|
hooks []func(context.Context, int) ([]types.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) ([]types.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) ([]types.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) ([]types.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 []types.UploadLog, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int) ([]types.UploadLog, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetAuditLogsForUploadFunc) PushReturn(r0 []types.UploadLog, r1 error) {
|
|
f.PushHook(func(context.Context, int) ([]types.UploadLog, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetAuditLogsForUploadFunc) nextHook() func(context.Context, int) ([]types.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 []types.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}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// StoreGetDirtyRepositoriesFunc describes the behavior when the
|
|
// GetDirtyRepositories method of the parent MockStore instance is invoked.
|
|
type StoreGetDirtyRepositoriesFunc struct {
|
|
defaultHook func(context.Context) (map[int]int, error)
|
|
hooks []func(context.Context) (map[int]int, 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) (map[int]int, 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) (map[int]int, 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) (map[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 *StoreGetDirtyRepositoriesFunc) SetDefaultReturn(r0 map[int]int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetDirtyRepositoriesFunc) PushReturn(r0 map[int]int, r1 error) {
|
|
f.PushHook(func(context.Context) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetDirtyRepositoriesFunc) nextHook() func(context.Context) (map[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 *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 map[int]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 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}
|
|
}
|
|
|
|
// StoreGetDumpsByIDsFunc describes the behavior when the GetDumpsByIDs
|
|
// method of the parent MockStore instance is invoked.
|
|
type StoreGetDumpsByIDsFunc struct {
|
|
defaultHook func(context.Context, []int) ([]types.Dump, error)
|
|
hooks []func(context.Context, []int) ([]types.Dump, error)
|
|
history []StoreGetDumpsByIDsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetDumpsByIDs delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockStore) GetDumpsByIDs(v0 context.Context, v1 []int) ([]types.Dump, error) {
|
|
r0, r1 := m.GetDumpsByIDsFunc.nextHook()(v0, v1)
|
|
m.GetDumpsByIDsFunc.appendCall(StoreGetDumpsByIDsFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the GetDumpsByIDs method
|
|
// of the parent MockStore instance is invoked and the hook queue is empty.
|
|
func (f *StoreGetDumpsByIDsFunc) SetDefaultHook(hook func(context.Context, []int) ([]types.Dump, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetDumpsByIDs 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 *StoreGetDumpsByIDsFunc) PushHook(hook func(context.Context, []int) ([]types.Dump, 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 *StoreGetDumpsByIDsFunc) SetDefaultReturn(r0 []types.Dump, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, []int) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetDumpsByIDsFunc) PushReturn(r0 []types.Dump, r1 error) {
|
|
f.PushHook(func(context.Context, []int) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetDumpsByIDsFunc) nextHook() func(context.Context, []int) ([]types.Dump, 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 *StoreGetDumpsByIDsFunc) appendCall(r0 StoreGetDumpsByIDsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreGetDumpsByIDsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreGetDumpsByIDsFunc) History() []StoreGetDumpsByIDsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreGetDumpsByIDsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreGetDumpsByIDsFuncCall is an object that describes an invocation of
|
|
// method GetDumpsByIDs on an instance of MockStore.
|
|
type StoreGetDumpsByIDsFuncCall 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 []types.Dump
|
|
// 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 StoreGetDumpsByIDsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreGetDumpsByIDsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// StoreGetDumpsWithDefinitionsForMonikersFunc describes the behavior when
|
|
// the GetDumpsWithDefinitionsForMonikers method of the parent MockStore
|
|
// instance is invoked.
|
|
type StoreGetDumpsWithDefinitionsForMonikersFunc struct {
|
|
defaultHook func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error)
|
|
hooks []func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error)
|
|
history []StoreGetDumpsWithDefinitionsForMonikersFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetDumpsWithDefinitionsForMonikers delegates to the next hook function in
|
|
// the queue and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) GetDumpsWithDefinitionsForMonikers(v0 context.Context, v1 []precise.QualifiedMonikerData) ([]types.Dump, error) {
|
|
r0, r1 := m.GetDumpsWithDefinitionsForMonikersFunc.nextHook()(v0, v1)
|
|
m.GetDumpsWithDefinitionsForMonikersFunc.appendCall(StoreGetDumpsWithDefinitionsForMonikersFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetDumpsWithDefinitionsForMonikers method of the parent MockStore
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *StoreGetDumpsWithDefinitionsForMonikersFunc) SetDefaultHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetDumpsWithDefinitionsForMonikers 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 *StoreGetDumpsWithDefinitionsForMonikersFunc) PushHook(hook func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, 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 *StoreGetDumpsWithDefinitionsForMonikersFunc) SetDefaultReturn(r0 []types.Dump, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetDumpsWithDefinitionsForMonikersFunc) PushReturn(r0 []types.Dump, r1 error) {
|
|
f.PushHook(func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetDumpsWithDefinitionsForMonikersFunc) nextHook() func(context.Context, []precise.QualifiedMonikerData) ([]types.Dump, 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 *StoreGetDumpsWithDefinitionsForMonikersFunc) appendCall(r0 StoreGetDumpsWithDefinitionsForMonikersFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// StoreGetDumpsWithDefinitionsForMonikersFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *StoreGetDumpsWithDefinitionsForMonikersFunc) History() []StoreGetDumpsWithDefinitionsForMonikersFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreGetDumpsWithDefinitionsForMonikersFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreGetDumpsWithDefinitionsForMonikersFuncCall is an object that
|
|
// describes an invocation of method GetDumpsWithDefinitionsForMonikers on
|
|
// an instance of MockStore.
|
|
type StoreGetDumpsWithDefinitionsForMonikersFuncCall 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 []types.Dump
|
|
// 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 StoreGetDumpsWithDefinitionsForMonikersFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreGetDumpsWithDefinitionsForMonikersFuncCall) 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}
|
|
}
|
|
|
|
// StoreGetOldestCommitDateFunc describes the behavior when the
|
|
// GetOldestCommitDate method of the parent MockStore instance is invoked.
|
|
type StoreGetOldestCommitDateFunc struct {
|
|
defaultHook func(context.Context, int) (time.Time, bool, error)
|
|
hooks []func(context.Context, int) (time.Time, bool, error)
|
|
history []StoreGetOldestCommitDateFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetOldestCommitDate delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockStore) GetOldestCommitDate(v0 context.Context, v1 int) (time.Time, bool, error) {
|
|
r0, r1, r2 := m.GetOldestCommitDateFunc.nextHook()(v0, v1)
|
|
m.GetOldestCommitDateFunc.appendCall(StoreGetOldestCommitDateFuncCall{v0, v1, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the GetOldestCommitDate
|
|
// method of the parent MockStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *StoreGetOldestCommitDateFunc) SetDefaultHook(hook func(context.Context, int) (time.Time, bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetOldestCommitDate 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 *StoreGetOldestCommitDateFunc) PushHook(hook func(context.Context, int) (time.Time, 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 *StoreGetOldestCommitDateFunc) SetDefaultReturn(r0 time.Time, r1 bool, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int) (time.Time, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetOldestCommitDateFunc) PushReturn(r0 time.Time, r1 bool, r2 error) {
|
|
f.PushHook(func(context.Context, int) (time.Time, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetOldestCommitDateFunc) nextHook() func(context.Context, int) (time.Time, 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 *StoreGetOldestCommitDateFunc) appendCall(r0 StoreGetOldestCommitDateFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreGetOldestCommitDateFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreGetOldestCommitDateFunc) History() []StoreGetOldestCommitDateFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreGetOldestCommitDateFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreGetOldestCommitDateFuncCall is an object that describes an
|
|
// invocation of method GetOldestCommitDate on an instance of MockStore.
|
|
type StoreGetOldestCommitDateFuncCall 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 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 StoreGetOldestCommitDateFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreGetOldestCommitDateFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// StoreGetRepositoriesForIndexScanFunc describes the behavior when the
|
|
// GetRepositoriesForIndexScan method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreGetRepositoriesForIndexScanFunc struct {
|
|
defaultHook func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error)
|
|
hooks []func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error)
|
|
history []StoreGetRepositoriesForIndexScanFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetRepositoriesForIndexScan delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) GetRepositoriesForIndexScan(v0 context.Context, v1 string, v2 string, v3 time.Duration, v4 bool, v5 *int, v6 int, v7 time.Time) ([]int, error) {
|
|
r0, r1 := m.GetRepositoriesForIndexScanFunc.nextHook()(v0, v1, v2, v3, v4, v5, v6, v7)
|
|
m.GetRepositoriesForIndexScanFunc.appendCall(StoreGetRepositoriesForIndexScanFuncCall{v0, v1, v2, v3, v4, v5, v6, v7, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetRepositoriesForIndexScan method of the parent MockStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *StoreGetRepositoriesForIndexScanFunc) SetDefaultHook(hook func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetRepositoriesForIndexScan 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 *StoreGetRepositoriesForIndexScanFunc) PushHook(hook func(context.Context, string, string, time.Duration, bool, *int, 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 *StoreGetRepositoriesForIndexScanFunc) SetDefaultReturn(r0 []int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetRepositoriesForIndexScanFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, string, string, time.Duration, bool, *int, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetRepositoriesForIndexScanFunc) nextHook() func(context.Context, string, string, time.Duration, bool, *int, 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 *StoreGetRepositoriesForIndexScanFunc) appendCall(r0 StoreGetRepositoriesForIndexScanFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreGetRepositoriesForIndexScanFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *StoreGetRepositoriesForIndexScanFunc) History() []StoreGetRepositoriesForIndexScanFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreGetRepositoriesForIndexScanFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreGetRepositoriesForIndexScanFuncCall is an object that describes an
|
|
// invocation of method GetRepositoriesForIndexScan on an instance of
|
|
// MockStore.
|
|
type StoreGetRepositoriesForIndexScanFuncCall 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 string
|
|
// 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 bool
|
|
// 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 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 StoreGetRepositoriesForIndexScanFuncCall) 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 StoreGetRepositoriesForIndexScanFuncCall) 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}
|
|
}
|
|
|
|
// StoreGetStaleSourcedCommitsFunc describes the behavior when the
|
|
// GetStaleSourcedCommits method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreGetStaleSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)
|
|
hooks []func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)
|
|
history []StoreGetStaleSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetStaleSourcedCommits delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) GetStaleSourcedCommits(v0 context.Context, v1 time.Duration, v2 int, v3 time.Time) ([]shared.SourcedCommits, error) {
|
|
r0, r1 := m.GetStaleSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.GetStaleSourcedCommitsFunc.appendCall(StoreGetStaleSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetStaleSourcedCommits method of the parent MockStore instance is invoked
|
|
// and the hook queue is empty.
|
|
func (f *StoreGetStaleSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetStaleSourcedCommits 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 *StoreGetStaleSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared.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 *StoreGetStaleSourcedCommitsFunc) SetDefaultReturn(r0 []shared.SourcedCommits, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetStaleSourcedCommitsFunc) PushReturn(r0 []shared.SourcedCommits, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetStaleSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, int, time.Time) ([]shared.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 *StoreGetStaleSourcedCommitsFunc) appendCall(r0 StoreGetStaleSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreGetStaleSourcedCommitsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreGetStaleSourcedCommitsFunc) History() []StoreGetStaleSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreGetStaleSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreGetStaleSourcedCommitsFuncCall is an object that describes an
|
|
// invocation of method GetStaleSourcedCommits on an instance of MockStore.
|
|
type StoreGetStaleSourcedCommitsFuncCall 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.Time
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []shared.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 StoreGetStaleSourcedCommitsFuncCall) 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 StoreGetStaleSourcedCommitsFuncCall) 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) (types.Upload, bool, error)
|
|
hooks []func(context.Context, int) (types.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) (types.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) (types.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) (types.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 types.Upload, r1 bool, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int) (types.Upload, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetUploadByIDFunc) PushReturn(r0 types.Upload, r1 bool, r2 error) {
|
|
f.PushHook(func(context.Context, int) (types.Upload, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetUploadByIDFunc) nextHook() func(context.Context, int) (types.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 types.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) ([]types.Upload, int, error)
|
|
hooks []func(context.Context, shared.GetUploadsOptions) ([]types.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) ([]types.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) ([]types.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) ([]types.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 []types.Upload, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetUploadsFunc) PushReturn(r0 []types.Upload, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetUploadsFunc) nextHook() func(context.Context, shared.GetUploadsOptions) ([]types.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 []types.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) ([]types.Upload, error)
|
|
hooks []func(context.Context, ...int) ([]types.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) ([]types.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) ([]types.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) ([]types.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 []types.Upload, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, ...int) ([]types.Upload, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreGetUploadsByIDsFunc) PushReturn(r0 []types.Upload, r1 error) {
|
|
f.PushHook(func(context.Context, ...int) ([]types.Upload, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreGetUploadsByIDsFunc) nextHook() func(context.Context, ...int) ([]types.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 []types.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}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// 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, int, string) (bool, error)
|
|
hooks []func(context.Context, int, string) (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 int, v2 string) (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, int, string) (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, int, string) (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, int, string) (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, int, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreHasCommitFunc) nextHook() func(context.Context, int, string) (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 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 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, int) (bool, error)
|
|
hooks []func(context.Context, int) (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 int) (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, int) (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, 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 *StoreHasRepositoryFunc) 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 *StoreHasRepositoryFunc) PushReturn(r0 bool, r1 error) {
|
|
f.PushHook(func(context.Context, int) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreHasRepositoryFunc) 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 *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 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 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, types.Upload) (int, error)
|
|
hooks []func(context.Context, types.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 types.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, types.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, types.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, types.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, types.Upload) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreInsertUploadFunc) nextHook() func(context.Context, types.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 types.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}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// StoreRepoNameFunc describes the behavior when the RepoName method of the
|
|
// parent MockStore instance is invoked.
|
|
type StoreRepoNameFunc struct {
|
|
defaultHook func(context.Context, int) (string, error)
|
|
hooks []func(context.Context, int) (string, error)
|
|
history []StoreRepoNameFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// RepoName delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockStore) RepoName(v0 context.Context, v1 int) (string, error) {
|
|
r0, r1 := m.RepoNameFunc.nextHook()(v0, v1)
|
|
m.RepoNameFunc.appendCall(StoreRepoNameFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the RepoName method of
|
|
// the parent MockStore instance is invoked and the hook queue is empty.
|
|
func (f *StoreRepoNameFunc) 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
|
|
// RepoName 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 *StoreRepoNameFunc) 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 *StoreRepoNameFunc) SetDefaultReturn(r0 string, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int) (string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreRepoNameFunc) PushReturn(r0 string, r1 error) {
|
|
f.PushHook(func(context.Context, int) (string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreRepoNameFunc) 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 *StoreRepoNameFunc) appendCall(r0 StoreRepoNameFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreRepoNameFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *StoreRepoNameFunc) History() []StoreRepoNameFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreRepoNameFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreRepoNameFuncCall is an object that describes an invocation of method
|
|
// RepoName on an instance of MockStore.
|
|
type StoreRepoNameFuncCall 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 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 StoreRepoNameFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreRepoNameFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// StoreRepoNamesFunc describes the behavior when the RepoNames method of
|
|
// the parent MockStore instance is invoked.
|
|
type StoreRepoNamesFunc struct {
|
|
defaultHook func(context.Context, ...int) (map[int]string, error)
|
|
hooks []func(context.Context, ...int) (map[int]string, error)
|
|
history []StoreRepoNamesFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// RepoNames delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockStore) RepoNames(v0 context.Context, v1 ...int) (map[int]string, error) {
|
|
r0, r1 := m.RepoNamesFunc.nextHook()(v0, v1...)
|
|
m.RepoNamesFunc.appendCall(StoreRepoNamesFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the RepoNames method of
|
|
// the parent MockStore instance is invoked and the hook queue is empty.
|
|
func (f *StoreRepoNamesFunc) SetDefaultHook(hook func(context.Context, ...int) (map[int]string, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// RepoNames 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 *StoreRepoNamesFunc) PushHook(hook func(context.Context, ...int) (map[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 *StoreRepoNamesFunc) SetDefaultReturn(r0 map[int]string, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, ...int) (map[int]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreRepoNamesFunc) PushReturn(r0 map[int]string, r1 error) {
|
|
f.PushHook(func(context.Context, ...int) (map[int]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreRepoNamesFunc) nextHook() func(context.Context, ...int) (map[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 *StoreRepoNamesFunc) appendCall(r0 StoreRepoNamesFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreRepoNamesFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *StoreRepoNamesFunc) History() []StoreRepoNamesFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreRepoNamesFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreRepoNamesFuncCall is an object that describes an invocation of
|
|
// method RepoNames on an instance of MockStore.
|
|
type StoreRepoNamesFuncCall 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 map[int]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. 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 StoreRepoNamesFuncCall) 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 StoreRepoNamesFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// StoreSetRepositoriesForRetentionScanWithTimeFunc describes the behavior
|
|
// when the SetRepositoriesForRetentionScanWithTime method of the parent
|
|
// MockStore instance is invoked.
|
|
type StoreSetRepositoriesForRetentionScanWithTimeFunc struct {
|
|
defaultHook func(context.Context, time.Duration, int, time.Time) ([]int, error)
|
|
hooks []func(context.Context, time.Duration, int, time.Time) ([]int, error)
|
|
history []StoreSetRepositoriesForRetentionScanWithTimeFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// SetRepositoriesForRetentionScanWithTime delegates to the next hook
|
|
// function in the queue and stores the parameter and result values of this
|
|
// invocation.
|
|
func (m *MockStore) SetRepositoriesForRetentionScanWithTime(v0 context.Context, v1 time.Duration, v2 int, v3 time.Time) ([]int, error) {
|
|
r0, r1 := m.SetRepositoriesForRetentionScanWithTimeFunc.nextHook()(v0, v1, v2, v3)
|
|
m.SetRepositoriesForRetentionScanWithTimeFunc.appendCall(StoreSetRepositoriesForRetentionScanWithTimeFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// SetRepositoriesForRetentionScanWithTime method of the parent MockStore
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *StoreSetRepositoriesForRetentionScanWithTimeFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Time) ([]int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// SetRepositoriesForRetentionScanWithTime 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 *StoreSetRepositoriesForRetentionScanWithTimeFunc) PushHook(hook func(context.Context, time.Duration, 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 *StoreSetRepositoriesForRetentionScanWithTimeFunc) SetDefaultReturn(r0 []int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreSetRepositoriesForRetentionScanWithTimeFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, int, time.Time) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreSetRepositoriesForRetentionScanWithTimeFunc) nextHook() func(context.Context, time.Duration, 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 *StoreSetRepositoriesForRetentionScanWithTimeFunc) appendCall(r0 StoreSetRepositoriesForRetentionScanWithTimeFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// StoreSetRepositoriesForRetentionScanWithTimeFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *StoreSetRepositoriesForRetentionScanWithTimeFunc) History() []StoreSetRepositoriesForRetentionScanWithTimeFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreSetRepositoriesForRetentionScanWithTimeFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreSetRepositoriesForRetentionScanWithTimeFuncCall is an object that
|
|
// describes an invocation of method SetRepositoriesForRetentionScanWithTime
|
|
// on an instance of MockStore.
|
|
type StoreSetRepositoriesForRetentionScanWithTimeFuncCall 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.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 StoreSetRepositoriesForRetentionScanWithTimeFuncCall) 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 StoreSetRepositoriesForRetentionScanWithTimeFuncCall) 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}
|
|
}
|
|
|
|
// StoreSoftDeleteExpiredUploadsFunc describes the behavior when the
|
|
// SoftDeleteExpiredUploads method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreSoftDeleteExpiredUploadsFunc struct {
|
|
defaultHook func(context.Context) (int, error)
|
|
hooks []func(context.Context) (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) (int, error) {
|
|
r0, r1 := m.SoftDeleteExpiredUploadsFunc.nextHook()(v0)
|
|
m.SoftDeleteExpiredUploadsFunc.appendCall(StoreSoftDeleteExpiredUploadsFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// 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, 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, 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 error) {
|
|
f.SetDefaultHook(func(context.Context) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreSoftDeleteExpiredUploadsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreSoftDeleteExpiredUploadsFunc) 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 *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
|
|
// 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 StoreSoftDeleteExpiredUploadsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreSoftDeleteExpiredUploadsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// StoreSourcedCommitsWithoutCommittedAtFunc describes the behavior when the
|
|
// SourcedCommitsWithoutCommittedAt method of the parent MockStore instance
|
|
// is invoked.
|
|
type StoreSourcedCommitsWithoutCommittedAtFunc struct {
|
|
defaultHook func(context.Context, int) ([]shared.SourcedCommits, error)
|
|
hooks []func(context.Context, int) ([]shared.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) ([]shared.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) ([]shared.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) ([]shared.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 []shared.SourcedCommits, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreSourcedCommitsWithoutCommittedAtFunc) PushReturn(r0 []shared.SourcedCommits, r1 error) {
|
|
f.PushHook(func(context.Context, int) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreSourcedCommitsWithoutCommittedAtFunc) nextHook() func(context.Context, int) ([]shared.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 []shared.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}
|
|
}
|
|
|
|
// StoreTransactFunc describes the behavior when the Transact method of the
|
|
// parent MockStore instance is invoked.
|
|
type StoreTransactFunc struct {
|
|
defaultHook func(context.Context) (store.Store, error)
|
|
hooks []func(context.Context) (store.Store, error)
|
|
history []StoreTransactFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Transact delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockStore) Transact(v0 context.Context) (store.Store, error) {
|
|
r0, r1 := m.TransactFunc.nextHook()(v0)
|
|
m.TransactFunc.appendCall(StoreTransactFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Transact method of
|
|
// the parent MockStore instance is invoked and the hook queue is empty.
|
|
func (f *StoreTransactFunc) SetDefaultHook(hook func(context.Context) (store.Store, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Transact 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 *StoreTransactFunc) PushHook(hook func(context.Context) (store.Store, 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 *StoreTransactFunc) SetDefaultReturn(r0 store.Store, r1 error) {
|
|
f.SetDefaultHook(func(context.Context) (store.Store, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreTransactFunc) PushReturn(r0 store.Store, r1 error) {
|
|
f.PushHook(func(context.Context) (store.Store, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreTransactFunc) nextHook() func(context.Context) (store.Store, 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 *StoreTransactFunc) appendCall(r0 StoreTransactFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreTransactFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *StoreTransactFunc) History() []StoreTransactFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreTransactFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreTransactFuncCall is an object that describes an invocation of method
|
|
// Transact on an instance of MockStore.
|
|
type StoreTransactFuncCall 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 store.Store
|
|
// 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 StoreTransactFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreTransactFuncCall) 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}
|
|
}
|
|
|
|
// StoreUpdateSourcedCommitsFunc describes the behavior when the
|
|
// UpdateSourcedCommits method of the parent MockStore instance is invoked.
|
|
type StoreUpdateSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Time) (int, error)
|
|
hooks []func(context.Context, int, string, time.Time) (int, error)
|
|
history []StoreUpdateSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// UpdateSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockStore) UpdateSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Time) (int, error) {
|
|
r0, r1 := m.UpdateSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.UpdateSourcedCommitsFunc.appendCall(StoreUpdateSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the UpdateSourcedCommits
|
|
// method of the parent MockStore instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *StoreUpdateSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// UpdateSourcedCommits 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 *StoreUpdateSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, 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 *StoreUpdateSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreUpdateSourcedCommitsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreUpdateSourcedCommitsFunc) nextHook() func(context.Context, int, string, 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 *StoreUpdateSourcedCommitsFunc) appendCall(r0 StoreUpdateSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreUpdateSourcedCommitsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *StoreUpdateSourcedCommitsFunc) History() []StoreUpdateSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreUpdateSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreUpdateSourcedCommitsFuncCall is an object that describes an
|
|
// invocation of method UpdateSourcedCommits on an instance of MockStore.
|
|
type StoreUpdateSourcedCommitsFuncCall 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 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 StoreUpdateSourcedCommitsFuncCall) 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 StoreUpdateSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// StoreUpdateUploadsReferenceCountsFunc describes the behavior when the
|
|
// UpdateUploadsReferenceCounts method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreUpdateUploadsReferenceCountsFunc struct {
|
|
defaultHook func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error)
|
|
hooks []func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error)
|
|
history []StoreUpdateUploadsReferenceCountsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// UpdateUploadsReferenceCounts delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockStore) UpdateUploadsReferenceCounts(v0 context.Context, v1 []int, v2 shared.DependencyReferenceCountUpdateType) (int, error) {
|
|
r0, r1 := m.UpdateUploadsReferenceCountsFunc.nextHook()(v0, v1, v2)
|
|
m.UpdateUploadsReferenceCountsFunc.appendCall(StoreUpdateUploadsReferenceCountsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// UpdateUploadsReferenceCounts method of the parent MockStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *StoreUpdateUploadsReferenceCountsFunc) SetDefaultHook(hook func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// UpdateUploadsReferenceCounts 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 *StoreUpdateUploadsReferenceCountsFunc) PushHook(hook func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (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 *StoreUpdateUploadsReferenceCountsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreUpdateUploadsReferenceCountsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *StoreUpdateUploadsReferenceCountsFunc) nextHook() func(context.Context, []int, shared.DependencyReferenceCountUpdateType) (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 *StoreUpdateUploadsReferenceCountsFunc) appendCall(r0 StoreUpdateUploadsReferenceCountsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of StoreUpdateUploadsReferenceCountsFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *StoreUpdateUploadsReferenceCountsFunc) History() []StoreUpdateUploadsReferenceCountsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]StoreUpdateUploadsReferenceCountsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// StoreUpdateUploadsReferenceCountsFuncCall is an object that describes an
|
|
// invocation of method UpdateUploadsReferenceCounts on an instance of
|
|
// MockStore.
|
|
type StoreUpdateUploadsReferenceCountsFuncCall 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 shared.DependencyReferenceCountUpdateType
|
|
// 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 StoreUpdateUploadsReferenceCountsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c StoreUpdateUploadsReferenceCountsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// StoreUpdateUploadsVisibleToCommitsFunc describes the behavior when the
|
|
// UpdateUploadsVisibleToCommits method of the parent MockStore instance is
|
|
// invoked.
|
|
type StoreUpdateUploadsVisibleToCommitsFunc struct {
|
|
defaultHook func(context.Context, int, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, time.Duration, time.Duration, int, time.Time) error
|
|
hooks []func(context.Context, int, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, 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 *gitdomain.CommitGraph, v3 map[string][]gitdomain.RefDescription, 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, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, 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, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, 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, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, 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, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, time.Duration, time.Duration, int, time.Time) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *StoreUpdateUploadsVisibleToCommitsFunc) nextHook() func(context.Context, int, *gitdomain.CommitGraph, map[string][]gitdomain.RefDescription, 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 *gitdomain.CommitGraph
|
|
// Arg3 is the value of the 4th argument passed to this method
|
|
// invocation.
|
|
Arg3 map[string][]gitdomain.RefDescription
|
|
// 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}
|
|
}
|
|
|
|
// StoreWorkerutilStoreFunc describes the behavior when the WorkerutilStore
|
|
// method of the parent MockStore instance is invoked.
|
|
type StoreWorkerutilStoreFunc struct {
|
|
defaultHook func(*observation.Context) store1.Store
|
|
hooks []func(*observation.Context) store1.Store
|
|
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 {
|
|
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) {
|
|
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) {
|
|
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) {
|
|
f.SetDefaultHook(func(*observation.Context) store1.Store {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *StoreWorkerutilStoreFunc) PushReturn(r0 store1.Store) {
|
|
f.PushHook(func(*observation.Context) store1.Store {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *StoreWorkerutilStoreFunc) nextHook() func(*observation.Context) store1.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 *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
|
|
}
|
|
|
|
// 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
|
|
// ResolveRevFunc is an instance of a mock function object controlling
|
|
// the behavior of the method ResolveRev.
|
|
ResolveRevFunc *RepoStoreResolveRevFunc
|
|
}
|
|
|
|
// 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 *types1.Repo, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
ResolveRevFunc: &RepoStoreResolveRevFunc{
|
|
defaultHook: func(context.Context, *types1.Repo, string) (r0 api.CommitID, 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) (*types1.Repo, error) {
|
|
panic("unexpected invocation of MockRepoStore.Get")
|
|
},
|
|
},
|
|
ResolveRevFunc: &RepoStoreResolveRevFunc{
|
|
defaultHook: func(context.Context, *types1.Repo, string) (api.CommitID, error) {
|
|
panic("unexpected invocation of MockRepoStore.ResolveRev")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// 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,
|
|
},
|
|
ResolveRevFunc: &RepoStoreResolveRevFunc{
|
|
defaultHook: i.ResolveRev,
|
|
},
|
|
}
|
|
}
|
|
|
|
// RepoStoreGetFunc describes the behavior when the Get method of the parent
|
|
// MockRepoStore instance is invoked.
|
|
type RepoStoreGetFunc struct {
|
|
defaultHook func(context.Context, api.RepoID) (*types1.Repo, error)
|
|
hooks []func(context.Context, api.RepoID) (*types1.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) (*types1.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) (*types1.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) (*types1.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 *types1.Repo, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, api.RepoID) (*types1.Repo, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *RepoStoreGetFunc) PushReturn(r0 *types1.Repo, r1 error) {
|
|
f.PushHook(func(context.Context, api.RepoID) (*types1.Repo, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *RepoStoreGetFunc) nextHook() func(context.Context, api.RepoID) (*types1.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 *types1.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}
|
|
}
|
|
|
|
// RepoStoreResolveRevFunc describes the behavior when the ResolveRev method
|
|
// of the parent MockRepoStore instance is invoked.
|
|
type RepoStoreResolveRevFunc struct {
|
|
defaultHook func(context.Context, *types1.Repo, string) (api.CommitID, error)
|
|
hooks []func(context.Context, *types1.Repo, string) (api.CommitID, error)
|
|
history []RepoStoreResolveRevFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ResolveRev delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockRepoStore) ResolveRev(v0 context.Context, v1 *types1.Repo, v2 string) (api.CommitID, error) {
|
|
r0, r1 := m.ResolveRevFunc.nextHook()(v0, v1, v2)
|
|
m.ResolveRevFunc.appendCall(RepoStoreResolveRevFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ResolveRev method of
|
|
// the parent MockRepoStore instance is invoked and the hook queue is empty.
|
|
func (f *RepoStoreResolveRevFunc) SetDefaultHook(hook func(context.Context, *types1.Repo, string) (api.CommitID, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ResolveRev 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 *RepoStoreResolveRevFunc) PushHook(hook func(context.Context, *types1.Repo, string) (api.CommitID, 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 *RepoStoreResolveRevFunc) SetDefaultReturn(r0 api.CommitID, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, *types1.Repo, string) (api.CommitID, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *RepoStoreResolveRevFunc) PushReturn(r0 api.CommitID, r1 error) {
|
|
f.PushHook(func(context.Context, *types1.Repo, string) (api.CommitID, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *RepoStoreResolveRevFunc) nextHook() func(context.Context, *types1.Repo, string) (api.CommitID, 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 *RepoStoreResolveRevFunc) appendCall(r0 RepoStoreResolveRevFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of RepoStoreResolveRevFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *RepoStoreResolveRevFunc) History() []RepoStoreResolveRevFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]RepoStoreResolveRevFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// RepoStoreResolveRevFuncCall is an object that describes an invocation of
|
|
// method ResolveRev on an instance of MockRepoStore.
|
|
type RepoStoreResolveRevFuncCall 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 *types1.Repo
|
|
// 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 api.CommitID
|
|
// 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 RepoStoreResolveRevFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c RepoStoreResolveRevFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// MockLsifStore is a mock implementation of the LsifStore interface (from
|
|
// the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/lsifstore)
|
|
// used for unit testing.
|
|
type MockLsifStore struct {
|
|
// DeleteLsifDataByUploadIdsFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteLsifDataByUploadIds.
|
|
DeleteLsifDataByUploadIdsFunc *LsifStoreDeleteLsifDataByUploadIdsFunc
|
|
// DoneFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Done.
|
|
DoneFunc *LsifStoreDoneFunc
|
|
// GetUploadDocumentsForPathFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// GetUploadDocumentsForPath.
|
|
GetUploadDocumentsForPathFunc *LsifStoreGetUploadDocumentsForPathFunc
|
|
// TransactFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Transact.
|
|
TransactFunc *LsifStoreTransactFunc
|
|
// WriteDefinitionsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WriteDefinitions.
|
|
WriteDefinitionsFunc *LsifStoreWriteDefinitionsFunc
|
|
// WriteDocumentsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WriteDocuments.
|
|
WriteDocumentsFunc *LsifStoreWriteDocumentsFunc
|
|
// WriteImplementationsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WriteImplementations.
|
|
WriteImplementationsFunc *LsifStoreWriteImplementationsFunc
|
|
// WriteMetaFunc is an instance of a mock function object controlling
|
|
// the behavior of the method WriteMeta.
|
|
WriteMetaFunc *LsifStoreWriteMetaFunc
|
|
// WriteReferencesFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WriteReferences.
|
|
WriteReferencesFunc *LsifStoreWriteReferencesFunc
|
|
// WriteResultChunksFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WriteResultChunks.
|
|
WriteResultChunksFunc *LsifStoreWriteResultChunksFunc
|
|
}
|
|
|
|
// NewMockLsifStore creates a new mock of the LsifStore interface. All
|
|
// methods return zero values for all results, unless overwritten.
|
|
func NewMockLsifStore() *MockLsifStore {
|
|
return &MockLsifStore{
|
|
DeleteLsifDataByUploadIdsFunc: &LsifStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: func(context.Context, ...int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
DoneFunc: &LsifStoreDoneFunc{
|
|
defaultHook: func(error) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
GetUploadDocumentsForPathFunc: &LsifStoreGetUploadDocumentsForPathFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 []string, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
TransactFunc: &LsifStoreTransactFunc{
|
|
defaultHook: func(context.Context) (r0 lsifstore.LsifStore, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteDefinitionsFunc: &LsifStoreWriteDefinitionsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (r0 uint32, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteDocumentsFunc: &LsifStoreWriteDocumentsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.KeyedDocumentData) (r0 uint32, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteImplementationsFunc: &LsifStoreWriteImplementationsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (r0 uint32, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteMetaFunc: &LsifStoreWriteMetaFunc{
|
|
defaultHook: func(context.Context, int, precise.MetaData) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteReferencesFunc: &LsifStoreWriteReferencesFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (r0 uint32, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WriteResultChunksFunc: &LsifStoreWriteResultChunksFunc{
|
|
defaultHook: func(context.Context, int, chan precise.IndexedResultChunkData) (r0 uint32, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockLsifStore creates a new mock of the LsifStore interface. All
|
|
// methods panic on invocation, unless overwritten.
|
|
func NewStrictMockLsifStore() *MockLsifStore {
|
|
return &MockLsifStore{
|
|
DeleteLsifDataByUploadIdsFunc: &LsifStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: func(context.Context, ...int) error {
|
|
panic("unexpected invocation of MockLsifStore.DeleteLsifDataByUploadIds")
|
|
},
|
|
},
|
|
DoneFunc: &LsifStoreDoneFunc{
|
|
defaultHook: func(error) error {
|
|
panic("unexpected invocation of MockLsifStore.Done")
|
|
},
|
|
},
|
|
GetUploadDocumentsForPathFunc: &LsifStoreGetUploadDocumentsForPathFunc{
|
|
defaultHook: func(context.Context, int, string) ([]string, int, error) {
|
|
panic("unexpected invocation of MockLsifStore.GetUploadDocumentsForPath")
|
|
},
|
|
},
|
|
TransactFunc: &LsifStoreTransactFunc{
|
|
defaultHook: func(context.Context) (lsifstore.LsifStore, error) {
|
|
panic("unexpected invocation of MockLsifStore.Transact")
|
|
},
|
|
},
|
|
WriteDefinitionsFunc: &LsifStoreWriteDefinitionsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
panic("unexpected invocation of MockLsifStore.WriteDefinitions")
|
|
},
|
|
},
|
|
WriteDocumentsFunc: &LsifStoreWriteDocumentsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error) {
|
|
panic("unexpected invocation of MockLsifStore.WriteDocuments")
|
|
},
|
|
},
|
|
WriteImplementationsFunc: &LsifStoreWriteImplementationsFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
panic("unexpected invocation of MockLsifStore.WriteImplementations")
|
|
},
|
|
},
|
|
WriteMetaFunc: &LsifStoreWriteMetaFunc{
|
|
defaultHook: func(context.Context, int, precise.MetaData) error {
|
|
panic("unexpected invocation of MockLsifStore.WriteMeta")
|
|
},
|
|
},
|
|
WriteReferencesFunc: &LsifStoreWriteReferencesFunc{
|
|
defaultHook: func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
panic("unexpected invocation of MockLsifStore.WriteReferences")
|
|
},
|
|
},
|
|
WriteResultChunksFunc: &LsifStoreWriteResultChunksFunc{
|
|
defaultHook: func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error) {
|
|
panic("unexpected invocation of MockLsifStore.WriteResultChunks")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockLsifStoreFrom creates a new mock of the MockLsifStore interface.
|
|
// All methods delegate to the given implementation, unless overwritten.
|
|
func NewMockLsifStoreFrom(i lsifstore.LsifStore) *MockLsifStore {
|
|
return &MockLsifStore{
|
|
DeleteLsifDataByUploadIdsFunc: &LsifStoreDeleteLsifDataByUploadIdsFunc{
|
|
defaultHook: i.DeleteLsifDataByUploadIds,
|
|
},
|
|
DoneFunc: &LsifStoreDoneFunc{
|
|
defaultHook: i.Done,
|
|
},
|
|
GetUploadDocumentsForPathFunc: &LsifStoreGetUploadDocumentsForPathFunc{
|
|
defaultHook: i.GetUploadDocumentsForPath,
|
|
},
|
|
TransactFunc: &LsifStoreTransactFunc{
|
|
defaultHook: i.Transact,
|
|
},
|
|
WriteDefinitionsFunc: &LsifStoreWriteDefinitionsFunc{
|
|
defaultHook: i.WriteDefinitions,
|
|
},
|
|
WriteDocumentsFunc: &LsifStoreWriteDocumentsFunc{
|
|
defaultHook: i.WriteDocuments,
|
|
},
|
|
WriteImplementationsFunc: &LsifStoreWriteImplementationsFunc{
|
|
defaultHook: i.WriteImplementations,
|
|
},
|
|
WriteMetaFunc: &LsifStoreWriteMetaFunc{
|
|
defaultHook: i.WriteMeta,
|
|
},
|
|
WriteReferencesFunc: &LsifStoreWriteReferencesFunc{
|
|
defaultHook: i.WriteReferences,
|
|
},
|
|
WriteResultChunksFunc: &LsifStoreWriteResultChunksFunc{
|
|
defaultHook: i.WriteResultChunks,
|
|
},
|
|
}
|
|
}
|
|
|
|
// 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}
|
|
}
|
|
|
|
// LsifStoreDoneFunc describes the behavior when the Done method of the
|
|
// parent MockLsifStore instance is invoked.
|
|
type LsifStoreDoneFunc struct {
|
|
defaultHook func(error) error
|
|
hooks []func(error) error
|
|
history []LsifStoreDoneFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Done delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockLsifStore) Done(v0 error) error {
|
|
r0 := m.DoneFunc.nextHook()(v0)
|
|
m.DoneFunc.appendCall(LsifStoreDoneFuncCall{v0, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Done method of the
|
|
// parent MockLsifStore instance is invoked and the hook queue is empty.
|
|
func (f *LsifStoreDoneFunc) SetDefaultHook(hook func(error) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Done 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 *LsifStoreDoneFunc) PushHook(hook func(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 *LsifStoreDoneFunc) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreDoneFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(error) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreDoneFunc) nextHook() func(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 *LsifStoreDoneFunc) appendCall(r0 LsifStoreDoneFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreDoneFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *LsifStoreDoneFunc) History() []LsifStoreDoneFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreDoneFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreDoneFuncCall is an object that describes an invocation of method
|
|
// Done on an instance of MockLsifStore.
|
|
type LsifStoreDoneFuncCall struct {
|
|
// Arg0 is the value of the 1st argument passed to this method
|
|
// invocation.
|
|
Arg0 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 LsifStoreDoneFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreDoneFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// LsifStoreGetUploadDocumentsForPathFunc describes the behavior when the
|
|
// GetUploadDocumentsForPath method of the parent MockLsifStore instance is
|
|
// invoked.
|
|
type LsifStoreGetUploadDocumentsForPathFunc struct {
|
|
defaultHook func(context.Context, int, string) ([]string, int, error)
|
|
hooks []func(context.Context, int, string) ([]string, int, error)
|
|
history []LsifStoreGetUploadDocumentsForPathFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetUploadDocumentsForPath delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) GetUploadDocumentsForPath(v0 context.Context, v1 int, v2 string) ([]string, int, error) {
|
|
r0, r1, r2 := m.GetUploadDocumentsForPathFunc.nextHook()(v0, v1, v2)
|
|
m.GetUploadDocumentsForPathFunc.appendCall(LsifStoreGetUploadDocumentsForPathFuncCall{v0, v1, v2, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetUploadDocumentsForPath method of the parent MockLsifStore instance is
|
|
// invoked and the hook queue is empty.
|
|
func (f *LsifStoreGetUploadDocumentsForPathFunc) SetDefaultHook(hook func(context.Context, int, string) ([]string, int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetUploadDocumentsForPath 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 *LsifStoreGetUploadDocumentsForPathFunc) PushHook(hook func(context.Context, int, string) ([]string, 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 *LsifStoreGetUploadDocumentsForPathFunc) SetDefaultReturn(r0 []string, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string) ([]string, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreGetUploadDocumentsForPathFunc) PushReturn(r0 []string, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, int, string) ([]string, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreGetUploadDocumentsForPathFunc) nextHook() func(context.Context, int, string) ([]string, 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 *LsifStoreGetUploadDocumentsForPathFunc) appendCall(r0 LsifStoreGetUploadDocumentsForPathFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreGetUploadDocumentsForPathFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LsifStoreGetUploadDocumentsForPathFunc) History() []LsifStoreGetUploadDocumentsForPathFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreGetUploadDocumentsForPathFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreGetUploadDocumentsForPathFuncCall is an object that describes an
|
|
// invocation of method GetUploadDocumentsForPath on an instance of
|
|
// MockLsifStore.
|
|
type LsifStoreGetUploadDocumentsForPathFuncCall 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 []string
|
|
// 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 LsifStoreGetUploadDocumentsForPathFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreGetUploadDocumentsForPathFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// LsifStoreTransactFunc describes the behavior when the Transact method of
|
|
// the parent MockLsifStore instance is invoked.
|
|
type LsifStoreTransactFunc struct {
|
|
defaultHook func(context.Context) (lsifstore.LsifStore, error)
|
|
hooks []func(context.Context) (lsifstore.LsifStore, error)
|
|
history []LsifStoreTransactFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Transact delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockLsifStore) Transact(v0 context.Context) (lsifstore.LsifStore, error) {
|
|
r0, r1 := m.TransactFunc.nextHook()(v0)
|
|
m.TransactFunc.appendCall(LsifStoreTransactFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Transact method of
|
|
// the parent MockLsifStore instance is invoked and the hook queue is empty.
|
|
func (f *LsifStoreTransactFunc) SetDefaultHook(hook func(context.Context) (lsifstore.LsifStore, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Transact 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 *LsifStoreTransactFunc) PushHook(hook func(context.Context) (lsifstore.LsifStore, 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 *LsifStoreTransactFunc) SetDefaultReturn(r0 lsifstore.LsifStore, r1 error) {
|
|
f.SetDefaultHook(func(context.Context) (lsifstore.LsifStore, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreTransactFunc) PushReturn(r0 lsifstore.LsifStore, r1 error) {
|
|
f.PushHook(func(context.Context) (lsifstore.LsifStore, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreTransactFunc) nextHook() func(context.Context) (lsifstore.LsifStore, 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 *LsifStoreTransactFunc) appendCall(r0 LsifStoreTransactFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreTransactFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreTransactFunc) History() []LsifStoreTransactFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreTransactFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreTransactFuncCall is an object that describes an invocation of
|
|
// method Transact on an instance of MockLsifStore.
|
|
type LsifStoreTransactFuncCall 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 lsifstore.LsifStore
|
|
// 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 LsifStoreTransactFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreTransactFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LsifStoreWriteDefinitionsFunc describes the behavior when the
|
|
// WriteDefinitions method of the parent MockLsifStore instance is invoked.
|
|
type LsifStoreWriteDefinitionsFunc struct {
|
|
defaultHook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
hooks []func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
history []LsifStoreWriteDefinitionsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteDefinitions delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteDefinitions(v0 context.Context, v1 int, v2 chan precise.MonikerLocations) (uint32, error) {
|
|
r0, r1 := m.WriteDefinitionsFunc.nextHook()(v0, v1, v2)
|
|
m.WriteDefinitionsFunc.appendCall(LsifStoreWriteDefinitionsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteDefinitions
|
|
// method of the parent MockLsifStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LsifStoreWriteDefinitionsFunc) SetDefaultHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteDefinitions 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 *LsifStoreWriteDefinitionsFunc) PushHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteDefinitionsFunc) SetDefaultReturn(r0 uint32, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteDefinitionsFunc) PushReturn(r0 uint32, r1 error) {
|
|
f.PushHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteDefinitionsFunc) nextHook() func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteDefinitionsFunc) appendCall(r0 LsifStoreWriteDefinitionsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteDefinitionsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreWriteDefinitionsFunc) History() []LsifStoreWriteDefinitionsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteDefinitionsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteDefinitionsFuncCall is an object that describes an
|
|
// invocation of method WriteDefinitions on an instance of MockLsifStore.
|
|
type LsifStoreWriteDefinitionsFuncCall 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 chan precise.MonikerLocations
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 uint32
|
|
// 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 LsifStoreWriteDefinitionsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteDefinitionsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LsifStoreWriteDocumentsFunc describes the behavior when the
|
|
// WriteDocuments method of the parent MockLsifStore instance is invoked.
|
|
type LsifStoreWriteDocumentsFunc struct {
|
|
defaultHook func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error)
|
|
hooks []func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error)
|
|
history []LsifStoreWriteDocumentsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteDocuments delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteDocuments(v0 context.Context, v1 int, v2 chan precise.KeyedDocumentData) (uint32, error) {
|
|
r0, r1 := m.WriteDocumentsFunc.nextHook()(v0, v1, v2)
|
|
m.WriteDocumentsFunc.appendCall(LsifStoreWriteDocumentsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteDocuments
|
|
// method of the parent MockLsifStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LsifStoreWriteDocumentsFunc) SetDefaultHook(hook func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteDocuments 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 *LsifStoreWriteDocumentsFunc) PushHook(hook func(context.Context, int, chan precise.KeyedDocumentData) (uint32, 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 *LsifStoreWriteDocumentsFunc) SetDefaultReturn(r0 uint32, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteDocumentsFunc) PushReturn(r0 uint32, r1 error) {
|
|
f.PushHook(func(context.Context, int, chan precise.KeyedDocumentData) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteDocumentsFunc) nextHook() func(context.Context, int, chan precise.KeyedDocumentData) (uint32, 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 *LsifStoreWriteDocumentsFunc) appendCall(r0 LsifStoreWriteDocumentsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteDocumentsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreWriteDocumentsFunc) History() []LsifStoreWriteDocumentsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteDocumentsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteDocumentsFuncCall is an object that describes an invocation
|
|
// of method WriteDocuments on an instance of MockLsifStore.
|
|
type LsifStoreWriteDocumentsFuncCall 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 chan precise.KeyedDocumentData
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 uint32
|
|
// 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 LsifStoreWriteDocumentsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteDocumentsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LsifStoreWriteImplementationsFunc describes the behavior when the
|
|
// WriteImplementations method of the parent MockLsifStore instance is
|
|
// invoked.
|
|
type LsifStoreWriteImplementationsFunc struct {
|
|
defaultHook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
hooks []func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
history []LsifStoreWriteImplementationsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteImplementations delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteImplementations(v0 context.Context, v1 int, v2 chan precise.MonikerLocations) (uint32, error) {
|
|
r0, r1 := m.WriteImplementationsFunc.nextHook()(v0, v1, v2)
|
|
m.WriteImplementationsFunc.appendCall(LsifStoreWriteImplementationsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteImplementations
|
|
// method of the parent MockLsifStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LsifStoreWriteImplementationsFunc) SetDefaultHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteImplementations 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 *LsifStoreWriteImplementationsFunc) PushHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteImplementationsFunc) SetDefaultReturn(r0 uint32, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteImplementationsFunc) PushReturn(r0 uint32, r1 error) {
|
|
f.PushHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteImplementationsFunc) nextHook() func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteImplementationsFunc) appendCall(r0 LsifStoreWriteImplementationsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteImplementationsFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *LsifStoreWriteImplementationsFunc) History() []LsifStoreWriteImplementationsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteImplementationsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteImplementationsFuncCall is an object that describes an
|
|
// invocation of method WriteImplementations on an instance of
|
|
// MockLsifStore.
|
|
type LsifStoreWriteImplementationsFuncCall 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 chan precise.MonikerLocations
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 uint32
|
|
// 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 LsifStoreWriteImplementationsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteImplementationsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LsifStoreWriteMetaFunc describes the behavior when the WriteMeta method
|
|
// of the parent MockLsifStore instance is invoked.
|
|
type LsifStoreWriteMetaFunc struct {
|
|
defaultHook func(context.Context, int, precise.MetaData) error
|
|
hooks []func(context.Context, int, precise.MetaData) error
|
|
history []LsifStoreWriteMetaFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteMeta delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteMeta(v0 context.Context, v1 int, v2 precise.MetaData) error {
|
|
r0 := m.WriteMetaFunc.nextHook()(v0, v1, v2)
|
|
m.WriteMetaFunc.appendCall(LsifStoreWriteMetaFuncCall{v0, v1, v2, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteMeta method of
|
|
// the parent MockLsifStore instance is invoked and the hook queue is empty.
|
|
func (f *LsifStoreWriteMetaFunc) SetDefaultHook(hook func(context.Context, int, precise.MetaData) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteMeta 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 *LsifStoreWriteMetaFunc) PushHook(hook func(context.Context, int, precise.MetaData) 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 *LsifStoreWriteMetaFunc) SetDefaultReturn(r0 error) {
|
|
f.SetDefaultHook(func(context.Context, int, precise.MetaData) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteMetaFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int, precise.MetaData) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteMetaFunc) nextHook() func(context.Context, int, precise.MetaData) 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 *LsifStoreWriteMetaFunc) appendCall(r0 LsifStoreWriteMetaFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteMetaFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreWriteMetaFunc) History() []LsifStoreWriteMetaFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteMetaFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteMetaFuncCall is an object that describes an invocation of
|
|
// method WriteMeta on an instance of MockLsifStore.
|
|
type LsifStoreWriteMetaFuncCall 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.MetaData
|
|
// 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 LsifStoreWriteMetaFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteMetaFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// LsifStoreWriteReferencesFunc describes the behavior when the
|
|
// WriteReferences method of the parent MockLsifStore instance is invoked.
|
|
type LsifStoreWriteReferencesFunc struct {
|
|
defaultHook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
hooks []func(context.Context, int, chan precise.MonikerLocations) (uint32, error)
|
|
history []LsifStoreWriteReferencesFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteReferences delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteReferences(v0 context.Context, v1 int, v2 chan precise.MonikerLocations) (uint32, error) {
|
|
r0, r1 := m.WriteReferencesFunc.nextHook()(v0, v1, v2)
|
|
m.WriteReferencesFunc.appendCall(LsifStoreWriteReferencesFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteReferences
|
|
// method of the parent MockLsifStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LsifStoreWriteReferencesFunc) SetDefaultHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteReferences 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 *LsifStoreWriteReferencesFunc) PushHook(hook func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteReferencesFunc) SetDefaultReturn(r0 uint32, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteReferencesFunc) PushReturn(r0 uint32, r1 error) {
|
|
f.PushHook(func(context.Context, int, chan precise.MonikerLocations) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteReferencesFunc) nextHook() func(context.Context, int, chan precise.MonikerLocations) (uint32, 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 *LsifStoreWriteReferencesFunc) appendCall(r0 LsifStoreWriteReferencesFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteReferencesFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreWriteReferencesFunc) History() []LsifStoreWriteReferencesFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteReferencesFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteReferencesFuncCall is an object that describes an
|
|
// invocation of method WriteReferences on an instance of MockLsifStore.
|
|
type LsifStoreWriteReferencesFuncCall 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 chan precise.MonikerLocations
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 uint32
|
|
// 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 LsifStoreWriteReferencesFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteReferencesFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// LsifStoreWriteResultChunksFunc describes the behavior when the
|
|
// WriteResultChunks method of the parent MockLsifStore instance is invoked.
|
|
type LsifStoreWriteResultChunksFunc struct {
|
|
defaultHook func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error)
|
|
hooks []func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error)
|
|
history []LsifStoreWriteResultChunksFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// WriteResultChunks delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockLsifStore) WriteResultChunks(v0 context.Context, v1 int, v2 chan precise.IndexedResultChunkData) (uint32, error) {
|
|
r0, r1 := m.WriteResultChunksFunc.nextHook()(v0, v1, v2)
|
|
m.WriteResultChunksFunc.appendCall(LsifStoreWriteResultChunksFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WriteResultChunks
|
|
// method of the parent MockLsifStore instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *LsifStoreWriteResultChunksFunc) SetDefaultHook(hook func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WriteResultChunks 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 *LsifStoreWriteResultChunksFunc) PushHook(hook func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, 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 *LsifStoreWriteResultChunksFunc) SetDefaultReturn(r0 uint32, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *LsifStoreWriteResultChunksFunc) PushReturn(r0 uint32, r1 error) {
|
|
f.PushHook(func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *LsifStoreWriteResultChunksFunc) nextHook() func(context.Context, int, chan precise.IndexedResultChunkData) (uint32, 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 *LsifStoreWriteResultChunksFunc) appendCall(r0 LsifStoreWriteResultChunksFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of LsifStoreWriteResultChunksFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *LsifStoreWriteResultChunksFunc) History() []LsifStoreWriteResultChunksFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]LsifStoreWriteResultChunksFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// LsifStoreWriteResultChunksFuncCall is an object that describes an
|
|
// invocation of method WriteResultChunks on an instance of MockLsifStore.
|
|
type LsifStoreWriteResultChunksFuncCall 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 chan precise.IndexedResultChunkData
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 uint32
|
|
// 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 LsifStoreWriteResultChunksFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c LsifStoreWriteResultChunksFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// MockAutoIndexingService is a mock implementation of the
|
|
// AutoIndexingService interface (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockAutoIndexingService struct {
|
|
// DeleteIndexesWithoutRepositoryFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteIndexesWithoutRepository.
|
|
DeleteIndexesWithoutRepositoryFunc *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc
|
|
// DeleteSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteSourcedCommits.
|
|
DeleteSourcedCommitsFunc *AutoIndexingServiceDeleteSourcedCommitsFunc
|
|
// GetStaleSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetStaleSourcedCommits.
|
|
GetStaleSourcedCommitsFunc *AutoIndexingServiceGetStaleSourcedCommitsFunc
|
|
// UpdateSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateSourcedCommits.
|
|
UpdateSourcedCommitsFunc *AutoIndexingServiceUpdateSourcedCommitsFunc
|
|
}
|
|
|
|
// NewMockAutoIndexingService creates a new mock of the AutoIndexingService
|
|
// interface. All methods return zero values for all results, unless
|
|
// overwritten.
|
|
func NewMockAutoIndexingService() *MockAutoIndexingService {
|
|
return &MockAutoIndexingService{
|
|
DeleteIndexesWithoutRepositoryFunc: &AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (r0 map[int]int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &AutoIndexingServiceDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &AutoIndexingServiceGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) (r0 []shared1.SourcedCommits, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &AutoIndexingServiceUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockAutoIndexingService creates a new mock of the
|
|
// AutoIndexingService interface. All methods panic on invocation, unless
|
|
// overwritten.
|
|
func NewStrictMockAutoIndexingService() *MockAutoIndexingService {
|
|
return &MockAutoIndexingService{
|
|
DeleteIndexesWithoutRepositoryFunc: &AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (map[int]int, error) {
|
|
panic("unexpected invocation of MockAutoIndexingService.DeleteIndexesWithoutRepository")
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &AutoIndexingServiceDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockAutoIndexingService.DeleteSourcedCommits")
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &AutoIndexingServiceGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error) {
|
|
panic("unexpected invocation of MockAutoIndexingService.GetStaleSourcedCommits")
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &AutoIndexingServiceUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockAutoIndexingService.UpdateSourcedCommits")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockAutoIndexingServiceFrom creates a new mock of the
|
|
// MockAutoIndexingService interface. All methods delegate to the given
|
|
// implementation, unless overwritten.
|
|
func NewMockAutoIndexingServiceFrom(i AutoIndexingService) *MockAutoIndexingService {
|
|
return &MockAutoIndexingService{
|
|
DeleteIndexesWithoutRepositoryFunc: &AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc{
|
|
defaultHook: i.DeleteIndexesWithoutRepository,
|
|
},
|
|
DeleteSourcedCommitsFunc: &AutoIndexingServiceDeleteSourcedCommitsFunc{
|
|
defaultHook: i.DeleteSourcedCommits,
|
|
},
|
|
GetStaleSourcedCommitsFunc: &AutoIndexingServiceGetStaleSourcedCommitsFunc{
|
|
defaultHook: i.GetStaleSourcedCommits,
|
|
},
|
|
UpdateSourcedCommitsFunc: &AutoIndexingServiceUpdateSourcedCommitsFunc{
|
|
defaultHook: i.UpdateSourcedCommits,
|
|
},
|
|
}
|
|
}
|
|
|
|
// AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc describes the
|
|
// behavior when the DeleteIndexesWithoutRepository method of the parent
|
|
// MockAutoIndexingService instance is invoked.
|
|
type AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc struct {
|
|
defaultHook func(context.Context, time.Time) (map[int]int, error)
|
|
hooks []func(context.Context, time.Time) (map[int]int, error)
|
|
history []AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteIndexesWithoutRepository delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockAutoIndexingService) DeleteIndexesWithoutRepository(v0 context.Context, v1 time.Time) (map[int]int, error) {
|
|
r0, r1 := m.DeleteIndexesWithoutRepositoryFunc.nextHook()(v0, v1)
|
|
m.DeleteIndexesWithoutRepositoryFunc.appendCall(AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteIndexesWithoutRepository method of the parent
|
|
// MockAutoIndexingService instance is invoked and the hook queue is empty.
|
|
func (f *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (map[int]int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteIndexesWithoutRepository method of the parent
|
|
// MockAutoIndexingService 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 *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (map[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 *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) SetDefaultReturn(r0 map[int]int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) PushReturn(r0 map[int]int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (map[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 *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) appendCall(r0 AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *AutoIndexingServiceDeleteIndexesWithoutRepositoryFunc) History() []AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall is an object
|
|
// that describes an invocation of method DeleteIndexesWithoutRepository on
|
|
// an instance of MockAutoIndexingService.
|
|
type AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall 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 map[int]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 AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c AutoIndexingServiceDeleteIndexesWithoutRepositoryFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// AutoIndexingServiceDeleteSourcedCommitsFunc describes the behavior when
|
|
// the DeleteSourcedCommits method of the parent MockAutoIndexingService
|
|
// instance is invoked.
|
|
type AutoIndexingServiceDeleteSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Duration, time.Time) (int, error)
|
|
hooks []func(context.Context, int, string, time.Duration, time.Time) (int, error)
|
|
history []AutoIndexingServiceDeleteSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockAutoIndexingService) DeleteSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Duration, v4 time.Time) (int, error) {
|
|
r0, r1 := m.DeleteSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.DeleteSourcedCommitsFunc.appendCall(AutoIndexingServiceDeleteSourcedCommitsFuncCall{v0, v1, v2, v3, v4, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the DeleteSourcedCommits
|
|
// method of the parent MockAutoIndexingService instance is invoked and the
|
|
// hook queue is empty.
|
|
func (f *AutoIndexingServiceDeleteSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Duration, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteSourcedCommits method of the parent MockAutoIndexingService
|
|
// 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 *AutoIndexingServiceDeleteSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, time.Duration, 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 *AutoIndexingServiceDeleteSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *AutoIndexingServiceDeleteSourcedCommitsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *AutoIndexingServiceDeleteSourcedCommitsFunc) nextHook() func(context.Context, int, string, time.Duration, 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 *AutoIndexingServiceDeleteSourcedCommitsFunc) appendCall(r0 AutoIndexingServiceDeleteSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// AutoIndexingServiceDeleteSourcedCommitsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *AutoIndexingServiceDeleteSourcedCommitsFunc) History() []AutoIndexingServiceDeleteSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]AutoIndexingServiceDeleteSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// AutoIndexingServiceDeleteSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method DeleteSourcedCommits on an instance of
|
|
// MockAutoIndexingService.
|
|
type AutoIndexingServiceDeleteSourcedCommitsFuncCall 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 time.Duration
|
|
// Arg4 is the value of the 5th argument passed to this method
|
|
// invocation.
|
|
Arg4 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 AutoIndexingServiceDeleteSourcedCommitsFuncCall) 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 AutoIndexingServiceDeleteSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// AutoIndexingServiceGetStaleSourcedCommitsFunc describes the behavior when
|
|
// the GetStaleSourcedCommits method of the parent MockAutoIndexingService
|
|
// instance is invoked.
|
|
type AutoIndexingServiceGetStaleSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error)
|
|
hooks []func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error)
|
|
history []AutoIndexingServiceGetStaleSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetStaleSourcedCommits delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockAutoIndexingService) GetStaleSourcedCommits(v0 context.Context, v1 time.Duration, v2 int, v3 time.Time) ([]shared1.SourcedCommits, error) {
|
|
r0, r1 := m.GetStaleSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.GetStaleSourcedCommitsFunc.appendCall(AutoIndexingServiceGetStaleSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetStaleSourcedCommits method of the parent MockAutoIndexingService
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *AutoIndexingServiceGetStaleSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetStaleSourcedCommits method of the parent MockAutoIndexingService
|
|
// 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 *AutoIndexingServiceGetStaleSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared1.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 *AutoIndexingServiceGetStaleSourcedCommitsFunc) SetDefaultReturn(r0 []shared1.SourcedCommits, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *AutoIndexingServiceGetStaleSourcedCommitsFunc) PushReturn(r0 []shared1.SourcedCommits, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, int, time.Time) ([]shared1.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *AutoIndexingServiceGetStaleSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, int, time.Time) ([]shared1.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 *AutoIndexingServiceGetStaleSourcedCommitsFunc) appendCall(r0 AutoIndexingServiceGetStaleSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// AutoIndexingServiceGetStaleSourcedCommitsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *AutoIndexingServiceGetStaleSourcedCommitsFunc) History() []AutoIndexingServiceGetStaleSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]AutoIndexingServiceGetStaleSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// AutoIndexingServiceGetStaleSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method GetStaleSourcedCommits on an instance
|
|
// of MockAutoIndexingService.
|
|
type AutoIndexingServiceGetStaleSourcedCommitsFuncCall 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.Time
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []shared1.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 AutoIndexingServiceGetStaleSourcedCommitsFuncCall) 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 AutoIndexingServiceGetStaleSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// AutoIndexingServiceUpdateSourcedCommitsFunc describes the behavior when
|
|
// the UpdateSourcedCommits method of the parent MockAutoIndexingService
|
|
// instance is invoked.
|
|
type AutoIndexingServiceUpdateSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Time) (int, error)
|
|
hooks []func(context.Context, int, string, time.Time) (int, error)
|
|
history []AutoIndexingServiceUpdateSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// UpdateSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockAutoIndexingService) UpdateSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Time) (int, error) {
|
|
r0, r1 := m.UpdateSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.UpdateSourcedCommitsFunc.appendCall(AutoIndexingServiceUpdateSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the UpdateSourcedCommits
|
|
// method of the parent MockAutoIndexingService instance is invoked and the
|
|
// hook queue is empty.
|
|
func (f *AutoIndexingServiceUpdateSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// UpdateSourcedCommits method of the parent MockAutoIndexingService
|
|
// 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 *AutoIndexingServiceUpdateSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, 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 *AutoIndexingServiceUpdateSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *AutoIndexingServiceUpdateSourcedCommitsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *AutoIndexingServiceUpdateSourcedCommitsFunc) nextHook() func(context.Context, int, string, 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 *AutoIndexingServiceUpdateSourcedCommitsFunc) appendCall(r0 AutoIndexingServiceUpdateSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// AutoIndexingServiceUpdateSourcedCommitsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *AutoIndexingServiceUpdateSourcedCommitsFunc) History() []AutoIndexingServiceUpdateSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]AutoIndexingServiceUpdateSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// AutoIndexingServiceUpdateSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method UpdateSourcedCommits on an instance of
|
|
// MockAutoIndexingService.
|
|
type AutoIndexingServiceUpdateSourcedCommitsFuncCall 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 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 AutoIndexingServiceUpdateSourcedCommitsFuncCall) 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 AutoIndexingServiceUpdateSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// MockGitserverClient is a mock implementation of the GitserverClient
|
|
// interface (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockGitserverClient struct {
|
|
// ArchiveReaderFunc is an instance of a mock function object
|
|
// controlling the behavior of the method ArchiveReader.
|
|
ArchiveReaderFunc *GitserverClientArchiveReaderFunc
|
|
// CommitDateFunc is an instance of a mock function object controlling
|
|
// the behavior of the method CommitDate.
|
|
CommitDateFunc *GitserverClientCommitDateFunc
|
|
// CommitExistsFunc is an instance of a mock function object controlling
|
|
// the behavior of the method CommitExists.
|
|
CommitExistsFunc *GitserverClientCommitExistsFunc
|
|
// CommitGraphFunc is an instance of a mock function object controlling
|
|
// the behavior of the method CommitGraph.
|
|
CommitGraphFunc *GitserverClientCommitGraphFunc
|
|
// CommitsUniqueToBranchFunc is an instance of a mock function object
|
|
// controlling the behavior of the method CommitsUniqueToBranch.
|
|
CommitsUniqueToBranchFunc *GitserverClientCommitsUniqueToBranchFunc
|
|
// DefaultBranchContainsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DefaultBranchContains.
|
|
DefaultBranchContainsFunc *GitserverClientDefaultBranchContainsFunc
|
|
// DirectoryChildrenFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DirectoryChildren.
|
|
DirectoryChildrenFunc *GitserverClientDirectoryChildrenFunc
|
|
// FileExistsFunc is an instance of a mock function object controlling
|
|
// the behavior of the method FileExists.
|
|
FileExistsFunc *GitserverClientFileExistsFunc
|
|
// HeadFunc is an instance of a mock function object controlling the
|
|
// behavior of the method Head.
|
|
HeadFunc *GitserverClientHeadFunc
|
|
// ListFilesFunc is an instance of a mock function object controlling
|
|
// the behavior of the method ListFiles.
|
|
ListFilesFunc *GitserverClientListFilesFunc
|
|
// ListTagsFunc is an instance of a mock function object controlling the
|
|
// behavior of the method ListTags.
|
|
ListTagsFunc *GitserverClientListTagsFunc
|
|
// RawContentsFunc is an instance of a mock function object controlling
|
|
// the behavior of the method RawContents.
|
|
RawContentsFunc *GitserverClientRawContentsFunc
|
|
// RefDescriptionsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method RefDescriptions.
|
|
RefDescriptionsFunc *GitserverClientRefDescriptionsFunc
|
|
// RequestRepoUpdateFunc is an instance of a mock function object
|
|
// controlling the behavior of the method RequestRepoUpdate.
|
|
RequestRepoUpdateFunc *GitserverClientRequestRepoUpdateFunc
|
|
// ResolveRevisionFunc is an instance of a mock function object
|
|
// controlling the behavior of the method ResolveRevision.
|
|
ResolveRevisionFunc *GitserverClientResolveRevisionFunc
|
|
}
|
|
|
|
// NewMockGitserverClient creates a new mock of the GitserverClient
|
|
// interface. All methods return zero values for all results, unless
|
|
// overwritten.
|
|
func NewMockGitserverClient() *MockGitserverClient {
|
|
return &MockGitserverClient{
|
|
ArchiveReaderFunc: &GitserverClientArchiveReaderFunc{
|
|
defaultHook: func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (r0 io.ReadCloser, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
CommitDateFunc: &GitserverClientCommitDateFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 string, r1 time.Time, r2 bool, r3 error) {
|
|
return
|
|
},
|
|
},
|
|
CommitExistsFunc: &GitserverClientCommitExistsFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
CommitGraphFunc: &GitserverClientCommitGraphFunc{
|
|
defaultHook: func(context.Context, int, gitserver.CommitGraphOptions) (r0 *gitdomain.CommitGraph, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
CommitsUniqueToBranchFunc: &GitserverClientCommitsUniqueToBranchFunc{
|
|
defaultHook: func(context.Context, int, string, bool, *time.Time) (r0 map[string]time.Time, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DefaultBranchContainsFunc: &GitserverClientDefaultBranchContainsFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DirectoryChildrenFunc: &GitserverClientDirectoryChildrenFunc{
|
|
defaultHook: func(context.Context, int, string, []string) (r0 map[string][]string, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
FileExistsFunc: &GitserverClientFileExistsFunc{
|
|
defaultHook: func(context.Context, int, string, string) (r0 bool, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
HeadFunc: &GitserverClientHeadFunc{
|
|
defaultHook: func(context.Context, int) (r0 string, r1 bool, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
ListFilesFunc: &GitserverClientListFilesFunc{
|
|
defaultHook: func(context.Context, int, string, *regexp.Regexp) (r0 []string, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
ListTagsFunc: &GitserverClientListTagsFunc{
|
|
defaultHook: func(context.Context, api.RepoName, ...string) (r0 []*gitdomain.Tag, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RawContentsFunc: &GitserverClientRawContentsFunc{
|
|
defaultHook: func(context.Context, int, string, string) (r0 []byte, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RefDescriptionsFunc: &GitserverClientRefDescriptionsFunc{
|
|
defaultHook: func(context.Context, int, ...string) (r0 map[string][]gitdomain.RefDescription, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
RequestRepoUpdateFunc: &GitserverClientRequestRepoUpdateFunc{
|
|
defaultHook: func(context.Context, api.RepoName, time.Duration) (r0 *protocol.RepoUpdateResponse, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
ResolveRevisionFunc: &GitserverClientResolveRevisionFunc{
|
|
defaultHook: func(context.Context, int, string) (r0 api.CommitID, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockGitserverClient creates a new mock of the GitserverClient
|
|
// interface. All methods panic on invocation, unless overwritten.
|
|
func NewStrictMockGitserverClient() *MockGitserverClient {
|
|
return &MockGitserverClient{
|
|
ArchiveReaderFunc: &GitserverClientArchiveReaderFunc{
|
|
defaultHook: func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error) {
|
|
panic("unexpected invocation of MockGitserverClient.ArchiveReader")
|
|
},
|
|
},
|
|
CommitDateFunc: &GitserverClientCommitDateFunc{
|
|
defaultHook: func(context.Context, int, string) (string, time.Time, bool, error) {
|
|
panic("unexpected invocation of MockGitserverClient.CommitDate")
|
|
},
|
|
},
|
|
CommitExistsFunc: &GitserverClientCommitExistsFunc{
|
|
defaultHook: func(context.Context, int, string) (bool, error) {
|
|
panic("unexpected invocation of MockGitserverClient.CommitExists")
|
|
},
|
|
},
|
|
CommitGraphFunc: &GitserverClientCommitGraphFunc{
|
|
defaultHook: func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error) {
|
|
panic("unexpected invocation of MockGitserverClient.CommitGraph")
|
|
},
|
|
},
|
|
CommitsUniqueToBranchFunc: &GitserverClientCommitsUniqueToBranchFunc{
|
|
defaultHook: func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error) {
|
|
panic("unexpected invocation of MockGitserverClient.CommitsUniqueToBranch")
|
|
},
|
|
},
|
|
DefaultBranchContainsFunc: &GitserverClientDefaultBranchContainsFunc{
|
|
defaultHook: func(context.Context, int, string) (bool, error) {
|
|
panic("unexpected invocation of MockGitserverClient.DefaultBranchContains")
|
|
},
|
|
},
|
|
DirectoryChildrenFunc: &GitserverClientDirectoryChildrenFunc{
|
|
defaultHook: func(context.Context, int, string, []string) (map[string][]string, error) {
|
|
panic("unexpected invocation of MockGitserverClient.DirectoryChildren")
|
|
},
|
|
},
|
|
FileExistsFunc: &GitserverClientFileExistsFunc{
|
|
defaultHook: func(context.Context, int, string, string) (bool, error) {
|
|
panic("unexpected invocation of MockGitserverClient.FileExists")
|
|
},
|
|
},
|
|
HeadFunc: &GitserverClientHeadFunc{
|
|
defaultHook: func(context.Context, int) (string, bool, error) {
|
|
panic("unexpected invocation of MockGitserverClient.Head")
|
|
},
|
|
},
|
|
ListFilesFunc: &GitserverClientListFilesFunc{
|
|
defaultHook: func(context.Context, int, string, *regexp.Regexp) ([]string, error) {
|
|
panic("unexpected invocation of MockGitserverClient.ListFiles")
|
|
},
|
|
},
|
|
ListTagsFunc: &GitserverClientListTagsFunc{
|
|
defaultHook: func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error) {
|
|
panic("unexpected invocation of MockGitserverClient.ListTags")
|
|
},
|
|
},
|
|
RawContentsFunc: &GitserverClientRawContentsFunc{
|
|
defaultHook: func(context.Context, int, string, string) ([]byte, error) {
|
|
panic("unexpected invocation of MockGitserverClient.RawContents")
|
|
},
|
|
},
|
|
RefDescriptionsFunc: &GitserverClientRefDescriptionsFunc{
|
|
defaultHook: func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error) {
|
|
panic("unexpected invocation of MockGitserverClient.RefDescriptions")
|
|
},
|
|
},
|
|
RequestRepoUpdateFunc: &GitserverClientRequestRepoUpdateFunc{
|
|
defaultHook: func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error) {
|
|
panic("unexpected invocation of MockGitserverClient.RequestRepoUpdate")
|
|
},
|
|
},
|
|
ResolveRevisionFunc: &GitserverClientResolveRevisionFunc{
|
|
defaultHook: func(context.Context, int, string) (api.CommitID, error) {
|
|
panic("unexpected invocation of MockGitserverClient.ResolveRevision")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockGitserverClientFrom creates a new mock of the MockGitserverClient
|
|
// interface. All methods delegate to the given implementation, unless
|
|
// overwritten.
|
|
func NewMockGitserverClientFrom(i GitserverClient) *MockGitserverClient {
|
|
return &MockGitserverClient{
|
|
ArchiveReaderFunc: &GitserverClientArchiveReaderFunc{
|
|
defaultHook: i.ArchiveReader,
|
|
},
|
|
CommitDateFunc: &GitserverClientCommitDateFunc{
|
|
defaultHook: i.CommitDate,
|
|
},
|
|
CommitExistsFunc: &GitserverClientCommitExistsFunc{
|
|
defaultHook: i.CommitExists,
|
|
},
|
|
CommitGraphFunc: &GitserverClientCommitGraphFunc{
|
|
defaultHook: i.CommitGraph,
|
|
},
|
|
CommitsUniqueToBranchFunc: &GitserverClientCommitsUniqueToBranchFunc{
|
|
defaultHook: i.CommitsUniqueToBranch,
|
|
},
|
|
DefaultBranchContainsFunc: &GitserverClientDefaultBranchContainsFunc{
|
|
defaultHook: i.DefaultBranchContains,
|
|
},
|
|
DirectoryChildrenFunc: &GitserverClientDirectoryChildrenFunc{
|
|
defaultHook: i.DirectoryChildren,
|
|
},
|
|
FileExistsFunc: &GitserverClientFileExistsFunc{
|
|
defaultHook: i.FileExists,
|
|
},
|
|
HeadFunc: &GitserverClientHeadFunc{
|
|
defaultHook: i.Head,
|
|
},
|
|
ListFilesFunc: &GitserverClientListFilesFunc{
|
|
defaultHook: i.ListFiles,
|
|
},
|
|
ListTagsFunc: &GitserverClientListTagsFunc{
|
|
defaultHook: i.ListTags,
|
|
},
|
|
RawContentsFunc: &GitserverClientRawContentsFunc{
|
|
defaultHook: i.RawContents,
|
|
},
|
|
RefDescriptionsFunc: &GitserverClientRefDescriptionsFunc{
|
|
defaultHook: i.RefDescriptions,
|
|
},
|
|
RequestRepoUpdateFunc: &GitserverClientRequestRepoUpdateFunc{
|
|
defaultHook: i.RequestRepoUpdate,
|
|
},
|
|
ResolveRevisionFunc: &GitserverClientResolveRevisionFunc{
|
|
defaultHook: i.ResolveRevision,
|
|
},
|
|
}
|
|
}
|
|
|
|
// GitserverClientArchiveReaderFunc describes the behavior when the
|
|
// ArchiveReader method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientArchiveReaderFunc struct {
|
|
defaultHook func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error)
|
|
hooks []func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error)
|
|
history []GitserverClientArchiveReaderFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ArchiveReader delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) ArchiveReader(v0 context.Context, v1 authz.SubRepoPermissionChecker, v2 api.RepoName, v3 gitserver.ArchiveOptions) (io.ReadCloser, error) {
|
|
r0, r1 := m.ArchiveReaderFunc.nextHook()(v0, v1, v2, v3)
|
|
m.ArchiveReaderFunc.appendCall(GitserverClientArchiveReaderFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ArchiveReader method
|
|
// of the parent MockGitserverClient instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *GitserverClientArchiveReaderFunc) SetDefaultHook(hook func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ArchiveReader method of the parent MockGitserverClient 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 *GitserverClientArchiveReaderFunc) PushHook(hook func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, 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 *GitserverClientArchiveReaderFunc) SetDefaultReturn(r0 io.ReadCloser, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientArchiveReaderFunc) PushReturn(r0 io.ReadCloser, r1 error) {
|
|
f.PushHook(func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientArchiveReaderFunc) nextHook() func(context.Context, authz.SubRepoPermissionChecker, api.RepoName, gitserver.ArchiveOptions) (io.ReadCloser, 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 *GitserverClientArchiveReaderFunc) appendCall(r0 GitserverClientArchiveReaderFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientArchiveReaderFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *GitserverClientArchiveReaderFunc) History() []GitserverClientArchiveReaderFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientArchiveReaderFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientArchiveReaderFuncCall is an object that describes an
|
|
// invocation of method ArchiveReader on an instance of MockGitserverClient.
|
|
type GitserverClientArchiveReaderFuncCall 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 authz.SubRepoPermissionChecker
|
|
// Arg2 is the value of the 3rd argument passed to this method
|
|
// invocation.
|
|
Arg2 api.RepoName
|
|
// Arg3 is the value of the 4th argument passed to this method
|
|
// invocation.
|
|
Arg3 gitserver.ArchiveOptions
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 io.ReadCloser
|
|
// 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 GitserverClientArchiveReaderFuncCall) 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 GitserverClientArchiveReaderFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientCommitDateFunc describes the behavior when the CommitDate
|
|
// method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientCommitDateFunc struct {
|
|
defaultHook func(context.Context, int, string) (string, time.Time, bool, error)
|
|
hooks []func(context.Context, int, string) (string, time.Time, bool, error)
|
|
history []GitserverClientCommitDateFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// CommitDate delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) CommitDate(v0 context.Context, v1 int, v2 string) (string, time.Time, bool, error) {
|
|
r0, r1, r2, r3 := m.CommitDateFunc.nextHook()(v0, v1, v2)
|
|
m.CommitDateFunc.appendCall(GitserverClientCommitDateFuncCall{v0, v1, v2, r0, r1, r2, r3})
|
|
return r0, r1, r2, r3
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the CommitDate method of
|
|
// the parent MockGitserverClient instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *GitserverClientCommitDateFunc) SetDefaultHook(hook func(context.Context, int, string) (string, time.Time, bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// CommitDate method of the parent MockGitserverClient 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 *GitserverClientCommitDateFunc) PushHook(hook func(context.Context, int, string) (string, time.Time, 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 *GitserverClientCommitDateFunc) SetDefaultReturn(r0 string, r1 time.Time, r2 bool, r3 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string) (string, time.Time, bool, error) {
|
|
return r0, r1, r2, r3
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientCommitDateFunc) PushReturn(r0 string, r1 time.Time, r2 bool, r3 error) {
|
|
f.PushHook(func(context.Context, int, string) (string, time.Time, bool, error) {
|
|
return r0, r1, r2, r3
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientCommitDateFunc) nextHook() func(context.Context, int, string) (string, time.Time, 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 *GitserverClientCommitDateFunc) appendCall(r0 GitserverClientCommitDateFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientCommitDateFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientCommitDateFunc) History() []GitserverClientCommitDateFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientCommitDateFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientCommitDateFuncCall is an object that describes an
|
|
// invocation of method CommitDate on an instance of MockGitserverClient.
|
|
type GitserverClientCommitDateFuncCall 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 string
|
|
// 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 bool
|
|
// 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 GitserverClientCommitDateFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientCommitDateFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2, c.Result3}
|
|
}
|
|
|
|
// GitserverClientCommitExistsFunc describes the behavior when the
|
|
// CommitExists method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientCommitExistsFunc struct {
|
|
defaultHook func(context.Context, int, string) (bool, error)
|
|
hooks []func(context.Context, int, string) (bool, error)
|
|
history []GitserverClientCommitExistsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// CommitExists delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) CommitExists(v0 context.Context, v1 int, v2 string) (bool, error) {
|
|
r0, r1 := m.CommitExistsFunc.nextHook()(v0, v1, v2)
|
|
m.CommitExistsFunc.appendCall(GitserverClientCommitExistsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the CommitExists method
|
|
// of the parent MockGitserverClient instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *GitserverClientCommitExistsFunc) SetDefaultHook(hook func(context.Context, int, string) (bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// CommitExists method of the parent MockGitserverClient 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 *GitserverClientCommitExistsFunc) PushHook(hook func(context.Context, int, string) (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 *GitserverClientCommitExistsFunc) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientCommitExistsFunc) PushReturn(r0 bool, r1 error) {
|
|
f.PushHook(func(context.Context, int, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientCommitExistsFunc) nextHook() func(context.Context, int, string) (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 *GitserverClientCommitExistsFunc) appendCall(r0 GitserverClientCommitExistsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientCommitExistsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientCommitExistsFunc) History() []GitserverClientCommitExistsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientCommitExistsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientCommitExistsFuncCall is an object that describes an
|
|
// invocation of method CommitExists on an instance of MockGitserverClient.
|
|
type GitserverClientCommitExistsFuncCall 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 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 GitserverClientCommitExistsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientCommitExistsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientCommitGraphFunc describes the behavior when the
|
|
// CommitGraph method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientCommitGraphFunc struct {
|
|
defaultHook func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error)
|
|
hooks []func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error)
|
|
history []GitserverClientCommitGraphFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// CommitGraph delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) CommitGraph(v0 context.Context, v1 int, v2 gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error) {
|
|
r0, r1 := m.CommitGraphFunc.nextHook()(v0, v1, v2)
|
|
m.CommitGraphFunc.appendCall(GitserverClientCommitGraphFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the CommitGraph method
|
|
// of the parent MockGitserverClient instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *GitserverClientCommitGraphFunc) SetDefaultHook(hook func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// CommitGraph method of the parent MockGitserverClient 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 *GitserverClientCommitGraphFunc) PushHook(hook func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, 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 *GitserverClientCommitGraphFunc) SetDefaultReturn(r0 *gitdomain.CommitGraph, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientCommitGraphFunc) PushReturn(r0 *gitdomain.CommitGraph, r1 error) {
|
|
f.PushHook(func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientCommitGraphFunc) nextHook() func(context.Context, int, gitserver.CommitGraphOptions) (*gitdomain.CommitGraph, 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 *GitserverClientCommitGraphFunc) appendCall(r0 GitserverClientCommitGraphFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientCommitGraphFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientCommitGraphFunc) History() []GitserverClientCommitGraphFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientCommitGraphFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientCommitGraphFuncCall is an object that describes an
|
|
// invocation of method CommitGraph on an instance of MockGitserverClient.
|
|
type GitserverClientCommitGraphFuncCall 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 gitserver.CommitGraphOptions
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 *gitdomain.CommitGraph
|
|
// 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 GitserverClientCommitGraphFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientCommitGraphFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientCommitsUniqueToBranchFunc describes the behavior when the
|
|
// CommitsUniqueToBranch method of the parent MockGitserverClient instance
|
|
// is invoked.
|
|
type GitserverClientCommitsUniqueToBranchFunc struct {
|
|
defaultHook func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error)
|
|
hooks []func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error)
|
|
history []GitserverClientCommitsUniqueToBranchFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// CommitsUniqueToBranch delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) CommitsUniqueToBranch(v0 context.Context, v1 int, v2 string, v3 bool, v4 *time.Time) (map[string]time.Time, error) {
|
|
r0, r1 := m.CommitsUniqueToBranchFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.CommitsUniqueToBranchFunc.appendCall(GitserverClientCommitsUniqueToBranchFuncCall{v0, v1, v2, v3, v4, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// CommitsUniqueToBranch method of the parent MockGitserverClient instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *GitserverClientCommitsUniqueToBranchFunc) SetDefaultHook(hook func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// CommitsUniqueToBranch method of the parent MockGitserverClient 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 *GitserverClientCommitsUniqueToBranchFunc) PushHook(hook func(context.Context, int, string, bool, *time.Time) (map[string]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 *GitserverClientCommitsUniqueToBranchFunc) SetDefaultReturn(r0 map[string]time.Time, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientCommitsUniqueToBranchFunc) PushReturn(r0 map[string]time.Time, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, bool, *time.Time) (map[string]time.Time, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientCommitsUniqueToBranchFunc) nextHook() func(context.Context, int, string, bool, *time.Time) (map[string]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 *GitserverClientCommitsUniqueToBranchFunc) appendCall(r0 GitserverClientCommitsUniqueToBranchFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// GitserverClientCommitsUniqueToBranchFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *GitserverClientCommitsUniqueToBranchFunc) History() []GitserverClientCommitsUniqueToBranchFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientCommitsUniqueToBranchFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientCommitsUniqueToBranchFuncCall is an object that describes
|
|
// an invocation of method CommitsUniqueToBranch on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientCommitsUniqueToBranchFuncCall 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 bool
|
|
// Arg4 is the value of the 5th argument passed to this method
|
|
// invocation.
|
|
Arg4 *time.Time
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 map[string]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 GitserverClientCommitsUniqueToBranchFuncCall) 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 GitserverClientCommitsUniqueToBranchFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientDefaultBranchContainsFunc describes the behavior when the
|
|
// DefaultBranchContains method of the parent MockGitserverClient instance
|
|
// is invoked.
|
|
type GitserverClientDefaultBranchContainsFunc struct {
|
|
defaultHook func(context.Context, int, string) (bool, error)
|
|
hooks []func(context.Context, int, string) (bool, error)
|
|
history []GitserverClientDefaultBranchContainsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DefaultBranchContains delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) DefaultBranchContains(v0 context.Context, v1 int, v2 string) (bool, error) {
|
|
r0, r1 := m.DefaultBranchContainsFunc.nextHook()(v0, v1, v2)
|
|
m.DefaultBranchContainsFunc.appendCall(GitserverClientDefaultBranchContainsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DefaultBranchContains method of the parent MockGitserverClient instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *GitserverClientDefaultBranchContainsFunc) SetDefaultHook(hook func(context.Context, int, string) (bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DefaultBranchContains method of the parent MockGitserverClient 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 *GitserverClientDefaultBranchContainsFunc) PushHook(hook func(context.Context, int, string) (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 *GitserverClientDefaultBranchContainsFunc) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientDefaultBranchContainsFunc) PushReturn(r0 bool, r1 error) {
|
|
f.PushHook(func(context.Context, int, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientDefaultBranchContainsFunc) nextHook() func(context.Context, int, string) (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 *GitserverClientDefaultBranchContainsFunc) appendCall(r0 GitserverClientDefaultBranchContainsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// GitserverClientDefaultBranchContainsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *GitserverClientDefaultBranchContainsFunc) History() []GitserverClientDefaultBranchContainsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientDefaultBranchContainsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientDefaultBranchContainsFuncCall is an object that describes
|
|
// an invocation of method DefaultBranchContains on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientDefaultBranchContainsFuncCall 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 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 GitserverClientDefaultBranchContainsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientDefaultBranchContainsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientDirectoryChildrenFunc describes the behavior when the
|
|
// DirectoryChildren method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientDirectoryChildrenFunc struct {
|
|
defaultHook func(context.Context, int, string, []string) (map[string][]string, error)
|
|
hooks []func(context.Context, int, string, []string) (map[string][]string, error)
|
|
history []GitserverClientDirectoryChildrenFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DirectoryChildren delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) DirectoryChildren(v0 context.Context, v1 int, v2 string, v3 []string) (map[string][]string, error) {
|
|
r0, r1 := m.DirectoryChildrenFunc.nextHook()(v0, v1, v2, v3)
|
|
m.DirectoryChildrenFunc.appendCall(GitserverClientDirectoryChildrenFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the DirectoryChildren
|
|
// method of the parent MockGitserverClient instance is invoked and the hook
|
|
// queue is empty.
|
|
func (f *GitserverClientDirectoryChildrenFunc) SetDefaultHook(hook func(context.Context, int, string, []string) (map[string][]string, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DirectoryChildren method of the parent MockGitserverClient 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 *GitserverClientDirectoryChildrenFunc) PushHook(hook func(context.Context, int, string, []string) (map[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 *GitserverClientDirectoryChildrenFunc) SetDefaultReturn(r0 map[string][]string, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, []string) (map[string][]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientDirectoryChildrenFunc) PushReturn(r0 map[string][]string, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, []string) (map[string][]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientDirectoryChildrenFunc) nextHook() func(context.Context, int, string, []string) (map[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 *GitserverClientDirectoryChildrenFunc) appendCall(r0 GitserverClientDirectoryChildrenFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientDirectoryChildrenFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *GitserverClientDirectoryChildrenFunc) History() []GitserverClientDirectoryChildrenFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientDirectoryChildrenFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientDirectoryChildrenFuncCall is an object that describes an
|
|
// invocation of method DirectoryChildren on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientDirectoryChildrenFuncCall 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 map[string][]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 GitserverClientDirectoryChildrenFuncCall) 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 GitserverClientDirectoryChildrenFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientFileExistsFunc describes the behavior when the FileExists
|
|
// method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientFileExistsFunc struct {
|
|
defaultHook func(context.Context, int, string, string) (bool, error)
|
|
hooks []func(context.Context, int, string, string) (bool, error)
|
|
history []GitserverClientFileExistsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// FileExists delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) FileExists(v0 context.Context, v1 int, v2 string, v3 string) (bool, error) {
|
|
r0, r1 := m.FileExistsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.FileExistsFunc.appendCall(GitserverClientFileExistsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the FileExists method of
|
|
// the parent MockGitserverClient instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *GitserverClientFileExistsFunc) SetDefaultHook(hook func(context.Context, int, string, string) (bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// FileExists method of the parent MockGitserverClient 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 *GitserverClientFileExistsFunc) PushHook(hook func(context.Context, int, string, string) (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 *GitserverClientFileExistsFunc) SetDefaultReturn(r0 bool, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientFileExistsFunc) PushReturn(r0 bool, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, string) (bool, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientFileExistsFunc) nextHook() func(context.Context, int, string, string) (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 *GitserverClientFileExistsFunc) appendCall(r0 GitserverClientFileExistsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientFileExistsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientFileExistsFunc) History() []GitserverClientFileExistsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientFileExistsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientFileExistsFuncCall is an object that describes an
|
|
// invocation of method FileExists on an instance of MockGitserverClient.
|
|
type GitserverClientFileExistsFuncCall 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 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 GitserverClientFileExistsFuncCall) 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 GitserverClientFileExistsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientHeadFunc describes the behavior when the Head method of
|
|
// the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientHeadFunc struct {
|
|
defaultHook func(context.Context, int) (string, bool, error)
|
|
hooks []func(context.Context, int) (string, bool, error)
|
|
history []GitserverClientHeadFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// Head delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) Head(v0 context.Context, v1 int) (string, bool, error) {
|
|
r0, r1, r2 := m.HeadFunc.nextHook()(v0, v1)
|
|
m.HeadFunc.appendCall(GitserverClientHeadFuncCall{v0, v1, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the Head method of the
|
|
// parent MockGitserverClient instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *GitserverClientHeadFunc) SetDefaultHook(hook func(context.Context, int) (string, bool, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// Head method of the parent MockGitserverClient 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 *GitserverClientHeadFunc) PushHook(hook func(context.Context, int) (string, 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 *GitserverClientHeadFunc) SetDefaultReturn(r0 string, r1 bool, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int) (string, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientHeadFunc) PushReturn(r0 string, r1 bool, r2 error) {
|
|
f.PushHook(func(context.Context, int) (string, bool, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientHeadFunc) nextHook() func(context.Context, int) (string, 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 *GitserverClientHeadFunc) appendCall(r0 GitserverClientHeadFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientHeadFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientHeadFunc) History() []GitserverClientHeadFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientHeadFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientHeadFuncCall is an object that describes an invocation of
|
|
// method Head on an instance of MockGitserverClient.
|
|
type GitserverClientHeadFuncCall 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 string
|
|
// 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 GitserverClientHeadFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientHeadFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// GitserverClientListFilesFunc describes the behavior when the ListFiles
|
|
// method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientListFilesFunc struct {
|
|
defaultHook func(context.Context, int, string, *regexp.Regexp) ([]string, error)
|
|
hooks []func(context.Context, int, string, *regexp.Regexp) ([]string, error)
|
|
history []GitserverClientListFilesFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ListFiles delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) ListFiles(v0 context.Context, v1 int, v2 string, v3 *regexp.Regexp) ([]string, error) {
|
|
r0, r1 := m.ListFilesFunc.nextHook()(v0, v1, v2, v3)
|
|
m.ListFilesFunc.appendCall(GitserverClientListFilesFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ListFiles method of
|
|
// the parent MockGitserverClient instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *GitserverClientListFilesFunc) SetDefaultHook(hook func(context.Context, int, string, *regexp.Regexp) ([]string, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ListFiles method of the parent MockGitserverClient 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 *GitserverClientListFilesFunc) PushHook(hook func(context.Context, int, string, *regexp.Regexp) ([]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 *GitserverClientListFilesFunc) SetDefaultReturn(r0 []string, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, *regexp.Regexp) ([]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientListFilesFunc) PushReturn(r0 []string, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, *regexp.Regexp) ([]string, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientListFilesFunc) nextHook() func(context.Context, int, string, *regexp.Regexp) ([]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 *GitserverClientListFilesFunc) appendCall(r0 GitserverClientListFilesFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientListFilesFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientListFilesFunc) History() []GitserverClientListFilesFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientListFilesFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientListFilesFuncCall is an object that describes an
|
|
// invocation of method ListFiles on an instance of MockGitserverClient.
|
|
type GitserverClientListFilesFuncCall 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 *regexp.Regexp
|
|
// 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 GitserverClientListFilesFuncCall) 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 GitserverClientListFilesFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientListTagsFunc describes the behavior when the ListTags
|
|
// method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientListTagsFunc struct {
|
|
defaultHook func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error)
|
|
hooks []func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error)
|
|
history []GitserverClientListTagsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ListTags delegates to the next hook function in the queue and stores the
|
|
// parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) ListTags(v0 context.Context, v1 api.RepoName, v2 ...string) ([]*gitdomain.Tag, error) {
|
|
r0, r1 := m.ListTagsFunc.nextHook()(v0, v1, v2...)
|
|
m.ListTagsFunc.appendCall(GitserverClientListTagsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ListTags method of
|
|
// the parent MockGitserverClient instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *GitserverClientListTagsFunc) SetDefaultHook(hook func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ListTags method of the parent MockGitserverClient 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 *GitserverClientListTagsFunc) PushHook(hook func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, 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 *GitserverClientListTagsFunc) SetDefaultReturn(r0 []*gitdomain.Tag, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientListTagsFunc) PushReturn(r0 []*gitdomain.Tag, r1 error) {
|
|
f.PushHook(func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientListTagsFunc) nextHook() func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, 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 *GitserverClientListTagsFunc) appendCall(r0 GitserverClientListTagsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientListTagsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientListTagsFunc) History() []GitserverClientListTagsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientListTagsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientListTagsFuncCall is an object that describes an invocation
|
|
// of method ListTags on an instance of MockGitserverClient.
|
|
type GitserverClientListTagsFuncCall 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.RepoName
|
|
// Arg2 is a slice containing the values of the variadic arguments
|
|
// passed to this method invocation.
|
|
Arg2 []string
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []*gitdomain.Tag
|
|
// 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 GitserverClientListTagsFuncCall) Args() []interface{} {
|
|
trailing := []interface{}{}
|
|
for _, val := range c.Arg2 {
|
|
trailing = append(trailing, val)
|
|
}
|
|
|
|
return append([]interface{}{c.Arg0, c.Arg1}, trailing...)
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientListTagsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientRawContentsFunc describes the behavior when the
|
|
// RawContents method of the parent MockGitserverClient instance is invoked.
|
|
type GitserverClientRawContentsFunc struct {
|
|
defaultHook func(context.Context, int, string, string) ([]byte, error)
|
|
hooks []func(context.Context, int, string, string) ([]byte, error)
|
|
history []GitserverClientRawContentsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// RawContents delegates to the next hook function in the queue and stores
|
|
// the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) RawContents(v0 context.Context, v1 int, v2 string, v3 string) ([]byte, error) {
|
|
r0, r1 := m.RawContentsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.RawContentsFunc.appendCall(GitserverClientRawContentsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the RawContents method
|
|
// of the parent MockGitserverClient instance is invoked and the hook queue
|
|
// is empty.
|
|
func (f *GitserverClientRawContentsFunc) SetDefaultHook(hook func(context.Context, int, string, string) ([]byte, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// RawContents method of the parent MockGitserverClient 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 *GitserverClientRawContentsFunc) PushHook(hook func(context.Context, int, string, string) ([]byte, 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 *GitserverClientRawContentsFunc) SetDefaultReturn(r0 []byte, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, string) ([]byte, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientRawContentsFunc) PushReturn(r0 []byte, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, string) ([]byte, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientRawContentsFunc) nextHook() func(context.Context, int, string, string) ([]byte, 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 *GitserverClientRawContentsFunc) appendCall(r0 GitserverClientRawContentsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientRawContentsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *GitserverClientRawContentsFunc) History() []GitserverClientRawContentsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientRawContentsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientRawContentsFuncCall is an object that describes an
|
|
// invocation of method RawContents on an instance of MockGitserverClient.
|
|
type GitserverClientRawContentsFuncCall 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 []byte
|
|
// 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 GitserverClientRawContentsFuncCall) 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 GitserverClientRawContentsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientRefDescriptionsFunc describes the behavior when the
|
|
// RefDescriptions method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientRefDescriptionsFunc struct {
|
|
defaultHook func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error)
|
|
hooks []func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error)
|
|
history []GitserverClientRefDescriptionsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// RefDescriptions delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) RefDescriptions(v0 context.Context, v1 int, v2 ...string) (map[string][]gitdomain.RefDescription, error) {
|
|
r0, r1 := m.RefDescriptionsFunc.nextHook()(v0, v1, v2...)
|
|
m.RefDescriptionsFunc.appendCall(GitserverClientRefDescriptionsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the RefDescriptions
|
|
// method of the parent MockGitserverClient instance is invoked and the hook
|
|
// queue is empty.
|
|
func (f *GitserverClientRefDescriptionsFunc) SetDefaultHook(hook func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// RefDescriptions method of the parent MockGitserverClient 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 *GitserverClientRefDescriptionsFunc) PushHook(hook func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, 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 *GitserverClientRefDescriptionsFunc) SetDefaultReturn(r0 map[string][]gitdomain.RefDescription, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientRefDescriptionsFunc) PushReturn(r0 map[string][]gitdomain.RefDescription, r1 error) {
|
|
f.PushHook(func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientRefDescriptionsFunc) nextHook() func(context.Context, int, ...string) (map[string][]gitdomain.RefDescription, 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 *GitserverClientRefDescriptionsFunc) appendCall(r0 GitserverClientRefDescriptionsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientRefDescriptionsFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *GitserverClientRefDescriptionsFunc) History() []GitserverClientRefDescriptionsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientRefDescriptionsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientRefDescriptionsFuncCall is an object that describes an
|
|
// invocation of method RefDescriptions on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientRefDescriptionsFuncCall 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 a slice containing the values of the variadic arguments
|
|
// passed to this method invocation.
|
|
Arg2 []string
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 map[string][]gitdomain.RefDescription
|
|
// 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 GitserverClientRefDescriptionsFuncCall) Args() []interface{} {
|
|
trailing := []interface{}{}
|
|
for _, val := range c.Arg2 {
|
|
trailing = append(trailing, val)
|
|
}
|
|
|
|
return append([]interface{}{c.Arg0, c.Arg1}, trailing...)
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientRefDescriptionsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientRequestRepoUpdateFunc describes the behavior when the
|
|
// RequestRepoUpdate method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientRequestRepoUpdateFunc struct {
|
|
defaultHook func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error)
|
|
hooks []func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error)
|
|
history []GitserverClientRequestRepoUpdateFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// RequestRepoUpdate delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) RequestRepoUpdate(v0 context.Context, v1 api.RepoName, v2 time.Duration) (*protocol.RepoUpdateResponse, error) {
|
|
r0, r1 := m.RequestRepoUpdateFunc.nextHook()(v0, v1, v2)
|
|
m.RequestRepoUpdateFunc.appendCall(GitserverClientRequestRepoUpdateFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the RequestRepoUpdate
|
|
// method of the parent MockGitserverClient instance is invoked and the hook
|
|
// queue is empty.
|
|
func (f *GitserverClientRequestRepoUpdateFunc) SetDefaultHook(hook func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// RequestRepoUpdate method of the parent MockGitserverClient 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 *GitserverClientRequestRepoUpdateFunc) PushHook(hook func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, 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 *GitserverClientRequestRepoUpdateFunc) SetDefaultReturn(r0 *protocol.RepoUpdateResponse, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientRequestRepoUpdateFunc) PushReturn(r0 *protocol.RepoUpdateResponse, r1 error) {
|
|
f.PushHook(func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientRequestRepoUpdateFunc) nextHook() func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, 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 *GitserverClientRequestRepoUpdateFunc) appendCall(r0 GitserverClientRequestRepoUpdateFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientRequestRepoUpdateFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *GitserverClientRequestRepoUpdateFunc) History() []GitserverClientRequestRepoUpdateFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientRequestRepoUpdateFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientRequestRepoUpdateFuncCall is an object that describes an
|
|
// invocation of method RequestRepoUpdate on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientRequestRepoUpdateFuncCall 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.RepoName
|
|
// Arg2 is the value of the 3rd argument passed to this method
|
|
// invocation.
|
|
Arg2 time.Duration
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 *protocol.RepoUpdateResponse
|
|
// 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 GitserverClientRequestRepoUpdateFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientRequestRepoUpdateFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// GitserverClientResolveRevisionFunc describes the behavior when the
|
|
// ResolveRevision method of the parent MockGitserverClient instance is
|
|
// invoked.
|
|
type GitserverClientResolveRevisionFunc struct {
|
|
defaultHook func(context.Context, int, string) (api.CommitID, error)
|
|
hooks []func(context.Context, int, string) (api.CommitID, error)
|
|
history []GitserverClientResolveRevisionFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// ResolveRevision delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockGitserverClient) ResolveRevision(v0 context.Context, v1 int, v2 string) (api.CommitID, error) {
|
|
r0, r1 := m.ResolveRevisionFunc.nextHook()(v0, v1, v2)
|
|
m.ResolveRevisionFunc.appendCall(GitserverClientResolveRevisionFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the ResolveRevision
|
|
// method of the parent MockGitserverClient instance is invoked and the hook
|
|
// queue is empty.
|
|
func (f *GitserverClientResolveRevisionFunc) SetDefaultHook(hook func(context.Context, int, string) (api.CommitID, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// ResolveRevision method of the parent MockGitserverClient 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 *GitserverClientResolveRevisionFunc) PushHook(hook func(context.Context, int, string) (api.CommitID, 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 *GitserverClientResolveRevisionFunc) SetDefaultReturn(r0 api.CommitID, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string) (api.CommitID, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *GitserverClientResolveRevisionFunc) PushReturn(r0 api.CommitID, r1 error) {
|
|
f.PushHook(func(context.Context, int, string) (api.CommitID, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *GitserverClientResolveRevisionFunc) nextHook() func(context.Context, int, string) (api.CommitID, 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 *GitserverClientResolveRevisionFunc) appendCall(r0 GitserverClientResolveRevisionFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of GitserverClientResolveRevisionFuncCall
|
|
// objects describing the invocations of this function.
|
|
func (f *GitserverClientResolveRevisionFunc) History() []GitserverClientResolveRevisionFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]GitserverClientResolveRevisionFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// GitserverClientResolveRevisionFuncCall is an object that describes an
|
|
// invocation of method ResolveRevision on an instance of
|
|
// MockGitserverClient.
|
|
type GitserverClientResolveRevisionFuncCall 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 api.CommitID
|
|
// 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 GitserverClientResolveRevisionFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c GitserverClientResolveRevisionFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// MockPolicyMatcher is a mock implementation of the PolicyMatcher interface
|
|
// (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockPolicyMatcher struct {
|
|
// CommitsDescribedByPolicyFunc is an instance of a mock function object
|
|
// controlling the behavior of the method CommitsDescribedByPolicy.
|
|
CommitsDescribedByPolicyFunc *PolicyMatcherCommitsDescribedByPolicyFunc
|
|
}
|
|
|
|
// NewMockPolicyMatcher creates a new mock of the PolicyMatcher interface.
|
|
// All methods return zero values for all results, unless overwritten.
|
|
func NewMockPolicyMatcher() *MockPolicyMatcher {
|
|
return &MockPolicyMatcher{
|
|
CommitsDescribedByPolicyFunc: &PolicyMatcherCommitsDescribedByPolicyFunc{
|
|
defaultHook: func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (r0 map[string][]enterprise.PolicyMatch, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockPolicyMatcher creates a new mock of the PolicyMatcher
|
|
// interface. All methods panic on invocation, unless overwritten.
|
|
func NewStrictMockPolicyMatcher() *MockPolicyMatcher {
|
|
return &MockPolicyMatcher{
|
|
CommitsDescribedByPolicyFunc: &PolicyMatcherCommitsDescribedByPolicyFunc{
|
|
defaultHook: func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error) {
|
|
panic("unexpected invocation of MockPolicyMatcher.CommitsDescribedByPolicy")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockPolicyMatcherFrom creates a new mock of the MockPolicyMatcher
|
|
// interface. All methods delegate to the given implementation, unless
|
|
// overwritten.
|
|
func NewMockPolicyMatcherFrom(i PolicyMatcher) *MockPolicyMatcher {
|
|
return &MockPolicyMatcher{
|
|
CommitsDescribedByPolicyFunc: &PolicyMatcherCommitsDescribedByPolicyFunc{
|
|
defaultHook: i.CommitsDescribedByPolicy,
|
|
},
|
|
}
|
|
}
|
|
|
|
// PolicyMatcherCommitsDescribedByPolicyFunc describes the behavior when the
|
|
// CommitsDescribedByPolicy method of the parent MockPolicyMatcher instance
|
|
// is invoked.
|
|
type PolicyMatcherCommitsDescribedByPolicyFunc struct {
|
|
defaultHook func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error)
|
|
hooks []func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error)
|
|
history []PolicyMatcherCommitsDescribedByPolicyFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// CommitsDescribedByPolicy delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockPolicyMatcher) CommitsDescribedByPolicy(v0 context.Context, v1 int, v2 []types.ConfigurationPolicy, v3 time.Time, v4 ...string) (map[string][]enterprise.PolicyMatch, error) {
|
|
r0, r1 := m.CommitsDescribedByPolicyFunc.nextHook()(v0, v1, v2, v3, v4...)
|
|
m.CommitsDescribedByPolicyFunc.appendCall(PolicyMatcherCommitsDescribedByPolicyFuncCall{v0, v1, v2, v3, v4, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// CommitsDescribedByPolicy method of the parent MockPolicyMatcher instance
|
|
// is invoked and the hook queue is empty.
|
|
func (f *PolicyMatcherCommitsDescribedByPolicyFunc) SetDefaultHook(hook func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// CommitsDescribedByPolicy method of the parent MockPolicyMatcher 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 *PolicyMatcherCommitsDescribedByPolicyFunc) PushHook(hook func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, 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 *PolicyMatcherCommitsDescribedByPolicyFunc) SetDefaultReturn(r0 map[string][]enterprise.PolicyMatch, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *PolicyMatcherCommitsDescribedByPolicyFunc) PushReturn(r0 map[string][]enterprise.PolicyMatch, r1 error) {
|
|
f.PushHook(func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *PolicyMatcherCommitsDescribedByPolicyFunc) nextHook() func(context.Context, int, []types.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, 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 *PolicyMatcherCommitsDescribedByPolicyFunc) appendCall(r0 PolicyMatcherCommitsDescribedByPolicyFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// PolicyMatcherCommitsDescribedByPolicyFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *PolicyMatcherCommitsDescribedByPolicyFunc) History() []PolicyMatcherCommitsDescribedByPolicyFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]PolicyMatcherCommitsDescribedByPolicyFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// PolicyMatcherCommitsDescribedByPolicyFuncCall is an object that describes
|
|
// an invocation of method CommitsDescribedByPolicy on an instance of
|
|
// MockPolicyMatcher.
|
|
type PolicyMatcherCommitsDescribedByPolicyFuncCall 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 []types.ConfigurationPolicy
|
|
// Arg3 is the value of the 4th argument passed to this method
|
|
// invocation.
|
|
Arg3 time.Time
|
|
// Arg4 is a slice containing the values of the variadic arguments
|
|
// passed to this method invocation.
|
|
Arg4 []string
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 map[string][]enterprise.PolicyMatch
|
|
// 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 PolicyMatcherCommitsDescribedByPolicyFuncCall) Args() []interface{} {
|
|
trailing := []interface{}{}
|
|
for _, val := range c.Arg4 {
|
|
trailing = append(trailing, val)
|
|
}
|
|
|
|
return append([]interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}, trailing...)
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c PolicyMatcherCommitsDescribedByPolicyFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// 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, shared2.GetConfigurationPoliciesOptions) (r0 []types.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, shared2.GetConfigurationPoliciesOptions) ([]types.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, shared2.GetConfigurationPoliciesOptions) ([]types.ConfigurationPolicy, int, error)
|
|
hooks []func(context.Context, shared2.GetConfigurationPoliciesOptions) ([]types.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 shared2.GetConfigurationPoliciesOptions) ([]types.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, shared2.GetConfigurationPoliciesOptions) ([]types.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, shared2.GetConfigurationPoliciesOptions) ([]types.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 []types.ConfigurationPolicy, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, shared2.GetConfigurationPoliciesOptions) ([]types.ConfigurationPolicy, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) PushReturn(r0 []types.ConfigurationPolicy, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, shared2.GetConfigurationPoliciesOptions) ([]types.ConfigurationPolicy, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *PolicyServiceGetConfigurationPoliciesFunc) nextHook() func(context.Context, shared2.GetConfigurationPoliciesOptions) ([]types.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 shared2.GetConfigurationPoliciesOptions
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []types.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}
|
|
}
|
|
|
|
// MockUploadServiceForCleanup is a mock implementation of the
|
|
// UploadServiceForCleanup interface (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockUploadServiceForCleanup struct {
|
|
// DeleteOldAuditLogsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteOldAuditLogs.
|
|
DeleteOldAuditLogsFunc *UploadServiceForCleanupDeleteOldAuditLogsFunc
|
|
// DeleteSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method DeleteSourcedCommits.
|
|
DeleteSourcedCommitsFunc *UploadServiceForCleanupDeleteSourcedCommitsFunc
|
|
// DeleteUploadsStuckUploadingFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteUploadsStuckUploading.
|
|
DeleteUploadsStuckUploadingFunc *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc
|
|
// DeleteUploadsWithoutRepositoryFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// DeleteUploadsWithoutRepository.
|
|
DeleteUploadsWithoutRepositoryFunc *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc
|
|
// GetStaleSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method GetStaleSourcedCommits.
|
|
GetStaleSourcedCommitsFunc *UploadServiceForCleanupGetStaleSourcedCommitsFunc
|
|
// HardDeleteExpiredUploadsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method HardDeleteExpiredUploads.
|
|
HardDeleteExpiredUploadsFunc *UploadServiceForCleanupHardDeleteExpiredUploadsFunc
|
|
// SoftDeleteExpiredUploadsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method SoftDeleteExpiredUploads.
|
|
SoftDeleteExpiredUploadsFunc *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc
|
|
// UpdateSourcedCommitsFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateSourcedCommits.
|
|
UpdateSourcedCommitsFunc *UploadServiceForCleanupUpdateSourcedCommitsFunc
|
|
// WorkerutilStoreFunc is an instance of a mock function object
|
|
// controlling the behavior of the method WorkerutilStore.
|
|
WorkerutilStoreFunc *UploadServiceForCleanupWorkerutilStoreFunc
|
|
}
|
|
|
|
// NewMockUploadServiceForCleanup creates a new mock of the
|
|
// UploadServiceForCleanup interface. All methods return zero values for all
|
|
// results, unless overwritten.
|
|
func NewMockUploadServiceForCleanup() *MockUploadServiceForCleanup {
|
|
return &MockUploadServiceForCleanup{
|
|
DeleteOldAuditLogsFunc: &UploadServiceForCleanupDeleteOldAuditLogsFunc{
|
|
defaultHook: func(context.Context, time.Duration, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &UploadServiceForCleanupDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (r0 int, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteUploadsStuckUploadingFunc: &UploadServiceForCleanupDeleteUploadsStuckUploadingFunc{
|
|
defaultHook: func(context.Context, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (r0 map[int]int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &UploadServiceForCleanupGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) (r0 []shared.SourcedCommits, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
HardDeleteExpiredUploadsFunc: &UploadServiceForCleanupHardDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &UploadServiceForCleanupSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &UploadServiceForCleanupUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (r0 int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
WorkerutilStoreFunc: &UploadServiceForCleanupWorkerutilStoreFunc{
|
|
defaultHook: func() (r0 store1.Store) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockUploadServiceForCleanup creates a new mock of the
|
|
// UploadServiceForCleanup interface. All methods panic on invocation,
|
|
// unless overwritten.
|
|
func NewStrictMockUploadServiceForCleanup() *MockUploadServiceForCleanup {
|
|
return &MockUploadServiceForCleanup{
|
|
DeleteOldAuditLogsFunc: &UploadServiceForCleanupDeleteOldAuditLogsFunc{
|
|
defaultHook: func(context.Context, time.Duration, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.DeleteOldAuditLogs")
|
|
},
|
|
},
|
|
DeleteSourcedCommitsFunc: &UploadServiceForCleanupDeleteSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.DeleteSourcedCommits")
|
|
},
|
|
},
|
|
DeleteUploadsStuckUploadingFunc: &UploadServiceForCleanupDeleteUploadsStuckUploadingFunc{
|
|
defaultHook: func(context.Context, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.DeleteUploadsStuckUploading")
|
|
},
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: func(context.Context, time.Time) (map[int]int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.DeleteUploadsWithoutRepository")
|
|
},
|
|
},
|
|
GetStaleSourcedCommitsFunc: &UploadServiceForCleanupGetStaleSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.GetStaleSourcedCommits")
|
|
},
|
|
},
|
|
HardDeleteExpiredUploadsFunc: &UploadServiceForCleanupHardDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.HardDeleteExpiredUploads")
|
|
},
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &UploadServiceForCleanupSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: func(context.Context) (int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.SoftDeleteExpiredUploads")
|
|
},
|
|
},
|
|
UpdateSourcedCommitsFunc: &UploadServiceForCleanupUpdateSourcedCommitsFunc{
|
|
defaultHook: func(context.Context, int, string, time.Time) (int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.UpdateSourcedCommits")
|
|
},
|
|
},
|
|
WorkerutilStoreFunc: &UploadServiceForCleanupWorkerutilStoreFunc{
|
|
defaultHook: func() store1.Store {
|
|
panic("unexpected invocation of MockUploadServiceForCleanup.WorkerutilStore")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockUploadServiceForCleanupFrom creates a new mock of the
|
|
// MockUploadServiceForCleanup interface. All methods delegate to the given
|
|
// implementation, unless overwritten.
|
|
func NewMockUploadServiceForCleanupFrom(i UploadServiceForCleanup) *MockUploadServiceForCleanup {
|
|
return &MockUploadServiceForCleanup{
|
|
DeleteOldAuditLogsFunc: &UploadServiceForCleanupDeleteOldAuditLogsFunc{
|
|
defaultHook: i.DeleteOldAuditLogs,
|
|
},
|
|
DeleteSourcedCommitsFunc: &UploadServiceForCleanupDeleteSourcedCommitsFunc{
|
|
defaultHook: i.DeleteSourcedCommits,
|
|
},
|
|
DeleteUploadsStuckUploadingFunc: &UploadServiceForCleanupDeleteUploadsStuckUploadingFunc{
|
|
defaultHook: i.DeleteUploadsStuckUploading,
|
|
},
|
|
DeleteUploadsWithoutRepositoryFunc: &UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc{
|
|
defaultHook: i.DeleteUploadsWithoutRepository,
|
|
},
|
|
GetStaleSourcedCommitsFunc: &UploadServiceForCleanupGetStaleSourcedCommitsFunc{
|
|
defaultHook: i.GetStaleSourcedCommits,
|
|
},
|
|
HardDeleteExpiredUploadsFunc: &UploadServiceForCleanupHardDeleteExpiredUploadsFunc{
|
|
defaultHook: i.HardDeleteExpiredUploads,
|
|
},
|
|
SoftDeleteExpiredUploadsFunc: &UploadServiceForCleanupSoftDeleteExpiredUploadsFunc{
|
|
defaultHook: i.SoftDeleteExpiredUploads,
|
|
},
|
|
UpdateSourcedCommitsFunc: &UploadServiceForCleanupUpdateSourcedCommitsFunc{
|
|
defaultHook: i.UpdateSourcedCommits,
|
|
},
|
|
WorkerutilStoreFunc: &UploadServiceForCleanupWorkerutilStoreFunc{
|
|
defaultHook: i.WorkerutilStore,
|
|
},
|
|
}
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteOldAuditLogsFunc describes the behavior when
|
|
// the DeleteOldAuditLogs method of the parent MockUploadServiceForCleanup
|
|
// instance is invoked.
|
|
type UploadServiceForCleanupDeleteOldAuditLogsFunc struct {
|
|
defaultHook func(context.Context, time.Duration, time.Time) (int, error)
|
|
hooks []func(context.Context, time.Duration, time.Time) (int, error)
|
|
history []UploadServiceForCleanupDeleteOldAuditLogsFuncCall
|
|
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 *MockUploadServiceForCleanup) DeleteOldAuditLogs(v0 context.Context, v1 time.Duration, v2 time.Time) (int, error) {
|
|
r0, r1 := m.DeleteOldAuditLogsFunc.nextHook()(v0, v1, v2)
|
|
m.DeleteOldAuditLogsFunc.appendCall(UploadServiceForCleanupDeleteOldAuditLogsFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the DeleteOldAuditLogs
|
|
// method of the parent MockUploadServiceForCleanup instance is invoked and
|
|
// the hook queue is empty.
|
|
func (f *UploadServiceForCleanupDeleteOldAuditLogsFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteOldAuditLogs method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupDeleteOldAuditLogsFunc) PushHook(hook func(context.Context, time.Duration, 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 *UploadServiceForCleanupDeleteOldAuditLogsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupDeleteOldAuditLogsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupDeleteOldAuditLogsFunc) nextHook() func(context.Context, time.Duration, 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 *UploadServiceForCleanupDeleteOldAuditLogsFunc) appendCall(r0 UploadServiceForCleanupDeleteOldAuditLogsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupDeleteOldAuditLogsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *UploadServiceForCleanupDeleteOldAuditLogsFunc) History() []UploadServiceForCleanupDeleteOldAuditLogsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupDeleteOldAuditLogsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteOldAuditLogsFuncCall is an object that
|
|
// describes an invocation of method DeleteOldAuditLogs on an instance of
|
|
// MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupDeleteOldAuditLogsFuncCall 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 error
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupDeleteOldAuditLogsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupDeleteOldAuditLogsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteSourcedCommitsFunc describes the behavior
|
|
// when the DeleteSourcedCommits method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupDeleteSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Duration, time.Time) (int, int, error)
|
|
hooks []func(context.Context, int, string, time.Duration, time.Time) (int, int, error)
|
|
history []UploadServiceForCleanupDeleteSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// DeleteSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockUploadServiceForCleanup) DeleteSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Duration, v4 time.Time) (int, int, error) {
|
|
r0, r1, r2 := m.DeleteSourcedCommitsFunc.nextHook()(v0, v1, v2, v3, v4)
|
|
m.DeleteSourcedCommitsFunc.appendCall(UploadServiceForCleanupDeleteSourcedCommitsFuncCall{v0, v1, v2, v3, v4, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the DeleteSourcedCommits
|
|
// method of the parent MockUploadServiceForCleanup instance is invoked and
|
|
// the hook queue is empty.
|
|
func (f *UploadServiceForCleanupDeleteSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Duration, time.Time) (int, int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteSourcedCommits method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupDeleteSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, 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 *UploadServiceForCleanupDeleteSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupDeleteSourcedCommitsFunc) PushReturn(r0 int, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Duration, time.Time) (int, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupDeleteSourcedCommitsFunc) nextHook() func(context.Context, int, string, 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 *UploadServiceForCleanupDeleteSourcedCommitsFunc) appendCall(r0 UploadServiceForCleanupDeleteSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupDeleteSourcedCommitsFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *UploadServiceForCleanupDeleteSourcedCommitsFunc) History() []UploadServiceForCleanupDeleteSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupDeleteSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method DeleteSourcedCommits on an instance of
|
|
// MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupDeleteSourcedCommitsFuncCall 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 time.Duration
|
|
// Arg4 is the value of the 5th argument passed to this method
|
|
// invocation.
|
|
Arg4 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 UploadServiceForCleanupDeleteSourcedCommitsFuncCall) 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 UploadServiceForCleanupDeleteSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteUploadsStuckUploadingFunc describes the
|
|
// behavior when the DeleteUploadsStuckUploading method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupDeleteUploadsStuckUploadingFunc struct {
|
|
defaultHook func(context.Context, time.Time) (int, error)
|
|
hooks []func(context.Context, time.Time) (int, error)
|
|
history []UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall
|
|
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 *MockUploadServiceForCleanup) DeleteUploadsStuckUploading(v0 context.Context, v1 time.Time) (int, error) {
|
|
r0, r1 := m.DeleteUploadsStuckUploadingFunc.nextHook()(v0, v1)
|
|
m.DeleteUploadsStuckUploadingFunc.appendCall(UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteUploadsStuckUploading method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) SetDefaultHook(hook func(context.Context, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// DeleteUploadsStuckUploading method of the parent
|
|
// MockUploadServiceForCleanup 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 *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) PushHook(hook func(context.Context, 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 *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) nextHook() func(context.Context, 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 *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) appendCall(r0 UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForCleanupDeleteUploadsStuckUploadingFunc) History() []UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall is an object
|
|
// that describes an invocation of method DeleteUploadsStuckUploading on an
|
|
// instance of MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall 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 error
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupDeleteUploadsStuckUploadingFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc describes the
|
|
// behavior when the DeleteUploadsWithoutRepository method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc struct {
|
|
defaultHook func(context.Context, time.Time) (map[int]int, error)
|
|
hooks []func(context.Context, time.Time) (map[int]int, error)
|
|
history []UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall
|
|
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 *MockUploadServiceForCleanup) DeleteUploadsWithoutRepository(v0 context.Context, v1 time.Time) (map[int]int, error) {
|
|
r0, r1 := m.DeleteUploadsWithoutRepositoryFunc.nextHook()(v0, v1)
|
|
m.DeleteUploadsWithoutRepositoryFunc.appendCall(UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall{v0, v1, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// DeleteUploadsWithoutRepository method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (map[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
|
|
// MockUploadServiceForCleanup 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 *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) PushHook(hook func(context.Context, time.Time) (map[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 *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) SetDefaultReturn(r0 map[int]int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) PushReturn(r0 map[int]int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Time) (map[int]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) nextHook() func(context.Context, time.Time) (map[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 *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) appendCall(r0 UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForCleanupDeleteUploadsWithoutRepositoryFunc) History() []UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall is an
|
|
// object that describes an invocation of method
|
|
// DeleteUploadsWithoutRepository on an instance of
|
|
// MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall 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 map[int]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 UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupDeleteUploadsWithoutRepositoryFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupGetStaleSourcedCommitsFunc describes the behavior
|
|
// when the GetStaleSourcedCommits method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupGetStaleSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)
|
|
hooks []func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)
|
|
history []UploadServiceForCleanupGetStaleSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// GetStaleSourcedCommits delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockUploadServiceForCleanup) GetStaleSourcedCommits(v0 context.Context, v1 time.Duration, v2 int, v3 time.Time) ([]shared.SourcedCommits, error) {
|
|
r0, r1 := m.GetStaleSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.GetStaleSourcedCommitsFunc.appendCall(UploadServiceForCleanupGetStaleSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetStaleSourcedCommits method of the parent MockUploadServiceForCleanup
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *UploadServiceForCleanupGetStaleSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// GetStaleSourcedCommits method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupGetStaleSourcedCommitsFunc) PushHook(hook func(context.Context, time.Duration, int, time.Time) ([]shared.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 *UploadServiceForCleanupGetStaleSourcedCommitsFunc) SetDefaultReturn(r0 []shared.SourcedCommits, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupGetStaleSourcedCommitsFunc) PushReturn(r0 []shared.SourcedCommits, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, int, time.Time) ([]shared.SourcedCommits, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupGetStaleSourcedCommitsFunc) nextHook() func(context.Context, time.Duration, int, time.Time) ([]shared.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 *UploadServiceForCleanupGetStaleSourcedCommitsFunc) appendCall(r0 UploadServiceForCleanupGetStaleSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupGetStaleSourcedCommitsFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *UploadServiceForCleanupGetStaleSourcedCommitsFunc) History() []UploadServiceForCleanupGetStaleSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupGetStaleSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupGetStaleSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method GetStaleSourcedCommits on an instance
|
|
// of MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupGetStaleSourcedCommitsFuncCall 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.Time
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 []shared.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 UploadServiceForCleanupGetStaleSourcedCommitsFuncCall) 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 UploadServiceForCleanupGetStaleSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupHardDeleteExpiredUploadsFunc describes the
|
|
// behavior when the HardDeleteExpiredUploads method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupHardDeleteExpiredUploadsFunc struct {
|
|
defaultHook func(context.Context) (int, error)
|
|
hooks []func(context.Context) (int, error)
|
|
history []UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// HardDeleteExpiredUploads delegates to the next hook function in the queue
|
|
// and stores the parameter and result values of this invocation.
|
|
func (m *MockUploadServiceForCleanup) HardDeleteExpiredUploads(v0 context.Context) (int, error) {
|
|
r0, r1 := m.HardDeleteExpiredUploadsFunc.nextHook()(v0)
|
|
m.HardDeleteExpiredUploadsFunc.appendCall(UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// HardDeleteExpiredUploads method of the parent MockUploadServiceForCleanup
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) SetDefaultHook(hook func(context.Context) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// HardDeleteExpiredUploads method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) appendCall(r0 UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForCleanupHardDeleteExpiredUploadsFunc) History() []UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall is an object that
|
|
// describes an invocation of method HardDeleteExpiredUploads on an instance
|
|
// of MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall 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 UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupHardDeleteExpiredUploadsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupSoftDeleteExpiredUploadsFunc describes the
|
|
// behavior when the SoftDeleteExpiredUploads method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupSoftDeleteExpiredUploadsFunc struct {
|
|
defaultHook func(context.Context) (int, error)
|
|
hooks []func(context.Context) (int, error)
|
|
history []UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall
|
|
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 *MockUploadServiceForCleanup) SoftDeleteExpiredUploads(v0 context.Context) (int, error) {
|
|
r0, r1 := m.SoftDeleteExpiredUploadsFunc.nextHook()(v0)
|
|
m.SoftDeleteExpiredUploadsFunc.appendCall(UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall{v0, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// SoftDeleteExpiredUploads method of the parent MockUploadServiceForCleanup
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) SetDefaultHook(hook func(context.Context) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// SoftDeleteExpiredUploads method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) 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 *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) appendCall(r0 UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForCleanupSoftDeleteExpiredUploadsFunc) History() []UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall is an object that
|
|
// describes an invocation of method SoftDeleteExpiredUploads on an instance
|
|
// of MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall 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 UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupSoftDeleteExpiredUploadsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupUpdateSourcedCommitsFunc describes the behavior
|
|
// when the UpdateSourcedCommits method of the parent
|
|
// MockUploadServiceForCleanup instance is invoked.
|
|
type UploadServiceForCleanupUpdateSourcedCommitsFunc struct {
|
|
defaultHook func(context.Context, int, string, time.Time) (int, error)
|
|
hooks []func(context.Context, int, string, time.Time) (int, error)
|
|
history []UploadServiceForCleanupUpdateSourcedCommitsFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// UpdateSourcedCommits delegates to the next hook function in the queue and
|
|
// stores the parameter and result values of this invocation.
|
|
func (m *MockUploadServiceForCleanup) UpdateSourcedCommits(v0 context.Context, v1 int, v2 string, v3 time.Time) (int, error) {
|
|
r0, r1 := m.UpdateSourcedCommitsFunc.nextHook()(v0, v1, v2, v3)
|
|
m.UpdateSourcedCommitsFunc.appendCall(UploadServiceForCleanupUpdateSourcedCommitsFuncCall{v0, v1, v2, v3, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the UpdateSourcedCommits
|
|
// method of the parent MockUploadServiceForCleanup instance is invoked and
|
|
// the hook queue is empty.
|
|
func (f *UploadServiceForCleanupUpdateSourcedCommitsFunc) SetDefaultHook(hook func(context.Context, int, string, time.Time) (int, error)) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// UpdateSourcedCommits method of the parent MockUploadServiceForCleanup
|
|
// 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 *UploadServiceForCleanupUpdateSourcedCommitsFunc) PushHook(hook func(context.Context, int, string, 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 *UploadServiceForCleanupUpdateSourcedCommitsFunc) SetDefaultReturn(r0 int, r1 error) {
|
|
f.SetDefaultHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupUpdateSourcedCommitsFunc) PushReturn(r0 int, r1 error) {
|
|
f.PushHook(func(context.Context, int, string, time.Time) (int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupUpdateSourcedCommitsFunc) nextHook() func(context.Context, int, string, 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 *UploadServiceForCleanupUpdateSourcedCommitsFunc) appendCall(r0 UploadServiceForCleanupUpdateSourcedCommitsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupUpdateSourcedCommitsFuncCall objects describing
|
|
// the invocations of this function.
|
|
func (f *UploadServiceForCleanupUpdateSourcedCommitsFunc) History() []UploadServiceForCleanupUpdateSourcedCommitsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupUpdateSourcedCommitsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupUpdateSourcedCommitsFuncCall is an object that
|
|
// describes an invocation of method UpdateSourcedCommits on an instance of
|
|
// MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupUpdateSourcedCommitsFuncCall 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 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 UploadServiceForCleanupUpdateSourcedCommitsFuncCall) 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 UploadServiceForCleanupUpdateSourcedCommitsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForCleanupWorkerutilStoreFunc describes the behavior when
|
|
// the WorkerutilStore method of the parent MockUploadServiceForCleanup
|
|
// instance is invoked.
|
|
type UploadServiceForCleanupWorkerutilStoreFunc struct {
|
|
defaultHook func() store1.Store
|
|
hooks []func() store1.Store
|
|
history []UploadServiceForCleanupWorkerutilStoreFuncCall
|
|
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 *MockUploadServiceForCleanup) WorkerutilStore() store1.Store {
|
|
r0 := m.WorkerutilStoreFunc.nextHook()()
|
|
m.WorkerutilStoreFunc.appendCall(UploadServiceForCleanupWorkerutilStoreFuncCall{r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the WorkerutilStore
|
|
// method of the parent MockUploadServiceForCleanup instance is invoked and
|
|
// the hook queue is empty.
|
|
func (f *UploadServiceForCleanupWorkerutilStoreFunc) SetDefaultHook(hook func() store1.Store) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// WorkerutilStore method of the parent MockUploadServiceForCleanup 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 *UploadServiceForCleanupWorkerutilStoreFunc) PushHook(hook func() store1.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 *UploadServiceForCleanupWorkerutilStoreFunc) SetDefaultReturn(r0 store1.Store) {
|
|
f.SetDefaultHook(func() store1.Store {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForCleanupWorkerutilStoreFunc) PushReturn(r0 store1.Store) {
|
|
f.PushHook(func() store1.Store {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForCleanupWorkerutilStoreFunc) nextHook() func() store1.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 *UploadServiceForCleanupWorkerutilStoreFunc) appendCall(r0 UploadServiceForCleanupWorkerutilStoreFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForCleanupWorkerutilStoreFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *UploadServiceForCleanupWorkerutilStoreFunc) History() []UploadServiceForCleanupWorkerutilStoreFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForCleanupWorkerutilStoreFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForCleanupWorkerutilStoreFuncCall is an object that
|
|
// describes an invocation of method WorkerutilStore on an instance of
|
|
// MockUploadServiceForCleanup.
|
|
type UploadServiceForCleanupWorkerutilStoreFuncCall struct {
|
|
// Result0 is the value of the 1st result returned from this method
|
|
// invocation.
|
|
Result0 store1.Store
|
|
}
|
|
|
|
// Args returns an interface slice containing the arguments of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupWorkerutilStoreFuncCall) Args() []interface{} {
|
|
return []interface{}{}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForCleanupWorkerutilStoreFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// MockUploadServiceForExpiration is a mock implementation of the
|
|
// UploadServiceForExpiration interface (from the package
|
|
// github.com/sourcegraph/sourcegraph/internal/codeintel/uploads) used for
|
|
// unit testing.
|
|
type MockUploadServiceForExpiration struct {
|
|
// BackfillReferenceCountBatchFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// BackfillReferenceCountBatch.
|
|
BackfillReferenceCountBatchFunc *UploadServiceForExpirationBackfillReferenceCountBatchFunc
|
|
// GetCommitsVisibleToUploadFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// GetCommitsVisibleToUpload.
|
|
GetCommitsVisibleToUploadFunc *UploadServiceForExpirationGetCommitsVisibleToUploadFunc
|
|
// GetUploadsFunc is an instance of a mock function object controlling
|
|
// the behavior of the method GetUploads.
|
|
GetUploadsFunc *UploadServiceForExpirationGetUploadsFunc
|
|
// SetRepositoriesForRetentionScanFunc is an instance of a mock function
|
|
// object controlling the behavior of the method
|
|
// SetRepositoriesForRetentionScan.
|
|
SetRepositoriesForRetentionScanFunc *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc
|
|
// UpdateUploadRetentionFunc is an instance of a mock function object
|
|
// controlling the behavior of the method UpdateUploadRetention.
|
|
UpdateUploadRetentionFunc *UploadServiceForExpirationUpdateUploadRetentionFunc
|
|
}
|
|
|
|
// NewMockUploadServiceForExpiration creates a new mock of the
|
|
// UploadServiceForExpiration interface. All methods return zero values for
|
|
// all results, unless overwritten.
|
|
func NewMockUploadServiceForExpiration() *MockUploadServiceForExpiration {
|
|
return &MockUploadServiceForExpiration{
|
|
BackfillReferenceCountBatchFunc: &UploadServiceForExpirationBackfillReferenceCountBatchFunc{
|
|
defaultHook: func(context.Context, int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
GetCommitsVisibleToUploadFunc: &UploadServiceForExpirationGetCommitsVisibleToUploadFunc{
|
|
defaultHook: func(context.Context, int, int, *string) (r0 []string, r1 *string, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
GetUploadsFunc: &UploadServiceForExpirationGetUploadsFunc{
|
|
defaultHook: func(context.Context, shared.GetUploadsOptions) (r0 []types.Upload, r1 int, r2 error) {
|
|
return
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &UploadServiceForExpirationSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: func(context.Context, time.Duration, int) (r0 []int, r1 error) {
|
|
return
|
|
},
|
|
},
|
|
UpdateUploadRetentionFunc: &UploadServiceForExpirationUpdateUploadRetentionFunc{
|
|
defaultHook: func(context.Context, []int, []int) (r0 error) {
|
|
return
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewStrictMockUploadServiceForExpiration creates a new mock of the
|
|
// UploadServiceForExpiration interface. All methods panic on invocation,
|
|
// unless overwritten.
|
|
func NewStrictMockUploadServiceForExpiration() *MockUploadServiceForExpiration {
|
|
return &MockUploadServiceForExpiration{
|
|
BackfillReferenceCountBatchFunc: &UploadServiceForExpirationBackfillReferenceCountBatchFunc{
|
|
defaultHook: func(context.Context, int) error {
|
|
panic("unexpected invocation of MockUploadServiceForExpiration.BackfillReferenceCountBatch")
|
|
},
|
|
},
|
|
GetCommitsVisibleToUploadFunc: &UploadServiceForExpirationGetCommitsVisibleToUploadFunc{
|
|
defaultHook: func(context.Context, int, int, *string) ([]string, *string, error) {
|
|
panic("unexpected invocation of MockUploadServiceForExpiration.GetCommitsVisibleToUpload")
|
|
},
|
|
},
|
|
GetUploadsFunc: &UploadServiceForExpirationGetUploadsFunc{
|
|
defaultHook: func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForExpiration.GetUploads")
|
|
},
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &UploadServiceForExpirationSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: func(context.Context, time.Duration, int) ([]int, error) {
|
|
panic("unexpected invocation of MockUploadServiceForExpiration.SetRepositoriesForRetentionScan")
|
|
},
|
|
},
|
|
UpdateUploadRetentionFunc: &UploadServiceForExpirationUpdateUploadRetentionFunc{
|
|
defaultHook: func(context.Context, []int, []int) error {
|
|
panic("unexpected invocation of MockUploadServiceForExpiration.UpdateUploadRetention")
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// NewMockUploadServiceForExpirationFrom creates a new mock of the
|
|
// MockUploadServiceForExpiration interface. All methods delegate to the
|
|
// given implementation, unless overwritten.
|
|
func NewMockUploadServiceForExpirationFrom(i UploadServiceForExpiration) *MockUploadServiceForExpiration {
|
|
return &MockUploadServiceForExpiration{
|
|
BackfillReferenceCountBatchFunc: &UploadServiceForExpirationBackfillReferenceCountBatchFunc{
|
|
defaultHook: i.BackfillReferenceCountBatch,
|
|
},
|
|
GetCommitsVisibleToUploadFunc: &UploadServiceForExpirationGetCommitsVisibleToUploadFunc{
|
|
defaultHook: i.GetCommitsVisibleToUpload,
|
|
},
|
|
GetUploadsFunc: &UploadServiceForExpirationGetUploadsFunc{
|
|
defaultHook: i.GetUploads,
|
|
},
|
|
SetRepositoriesForRetentionScanFunc: &UploadServiceForExpirationSetRepositoriesForRetentionScanFunc{
|
|
defaultHook: i.SetRepositoriesForRetentionScan,
|
|
},
|
|
UpdateUploadRetentionFunc: &UploadServiceForExpirationUpdateUploadRetentionFunc{
|
|
defaultHook: i.UpdateUploadRetention,
|
|
},
|
|
}
|
|
}
|
|
|
|
// UploadServiceForExpirationBackfillReferenceCountBatchFunc describes the
|
|
// behavior when the BackfillReferenceCountBatch method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked.
|
|
type UploadServiceForExpirationBackfillReferenceCountBatchFunc struct {
|
|
defaultHook func(context.Context, int) error
|
|
hooks []func(context.Context, int) error
|
|
history []UploadServiceForExpirationBackfillReferenceCountBatchFuncCall
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// BackfillReferenceCountBatch delegates to the next hook function in the
|
|
// queue and stores the parameter and result values of this invocation.
|
|
func (m *MockUploadServiceForExpiration) BackfillReferenceCountBatch(v0 context.Context, v1 int) error {
|
|
r0 := m.BackfillReferenceCountBatchFunc.nextHook()(v0, v1)
|
|
m.BackfillReferenceCountBatchFunc.appendCall(UploadServiceForExpirationBackfillReferenceCountBatchFuncCall{v0, v1, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// BackfillReferenceCountBatch method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *UploadServiceForExpirationBackfillReferenceCountBatchFunc) SetDefaultHook(hook func(context.Context, int) error) {
|
|
f.defaultHook = hook
|
|
}
|
|
|
|
// PushHook adds a function to the end of hook queue. Each invocation of the
|
|
// BackfillReferenceCountBatch method of the parent
|
|
// MockUploadServiceForExpiration 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 *UploadServiceForExpirationBackfillReferenceCountBatchFunc) 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 *UploadServiceForExpirationBackfillReferenceCountBatchFunc) 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 *UploadServiceForExpirationBackfillReferenceCountBatchFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, int) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForExpirationBackfillReferenceCountBatchFunc) 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 *UploadServiceForExpirationBackfillReferenceCountBatchFunc) appendCall(r0 UploadServiceForExpirationBackfillReferenceCountBatchFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForExpirationBackfillReferenceCountBatchFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForExpirationBackfillReferenceCountBatchFunc) History() []UploadServiceForExpirationBackfillReferenceCountBatchFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForExpirationBackfillReferenceCountBatchFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForExpirationBackfillReferenceCountBatchFuncCall is an
|
|
// object that describes an invocation of method BackfillReferenceCountBatch
|
|
// on an instance of MockUploadServiceForExpiration.
|
|
type UploadServiceForExpirationBackfillReferenceCountBatchFuncCall 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 UploadServiceForExpirationBackfillReferenceCountBatchFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForExpirationBackfillReferenceCountBatchFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|
|
|
|
// UploadServiceForExpirationGetCommitsVisibleToUploadFunc describes the
|
|
// behavior when the GetCommitsVisibleToUpload method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked.
|
|
type UploadServiceForExpirationGetCommitsVisibleToUploadFunc struct {
|
|
defaultHook func(context.Context, int, int, *string) ([]string, *string, error)
|
|
hooks []func(context.Context, int, int, *string) ([]string, *string, error)
|
|
history []UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall
|
|
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 *MockUploadServiceForExpiration) 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(UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall{v0, v1, v2, v3, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// GetCommitsVisibleToUpload method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) 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
|
|
// MockUploadServiceForExpiration 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 *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) 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 *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) 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 *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) PushReturn(r0 []string, r1 *string, r2 error) {
|
|
f.PushHook(func(context.Context, int, int, *string) ([]string, *string, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) 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 *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) appendCall(r0 UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForExpirationGetCommitsVisibleToUploadFunc) History() []UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall is an object
|
|
// that describes an invocation of method GetCommitsVisibleToUpload on an
|
|
// instance of MockUploadServiceForExpiration.
|
|
type UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall 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 UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall) 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 UploadServiceForExpirationGetCommitsVisibleToUploadFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// UploadServiceForExpirationGetUploadsFunc describes the behavior when the
|
|
// GetUploads method of the parent MockUploadServiceForExpiration instance
|
|
// is invoked.
|
|
type UploadServiceForExpirationGetUploadsFunc struct {
|
|
defaultHook func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error)
|
|
hooks []func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error)
|
|
history []UploadServiceForExpirationGetUploadsFuncCall
|
|
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 *MockUploadServiceForExpiration) GetUploads(v0 context.Context, v1 shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
r0, r1, r2 := m.GetUploadsFunc.nextHook()(v0, v1)
|
|
m.GetUploadsFunc.appendCall(UploadServiceForExpirationGetUploadsFuncCall{v0, v1, r0, r1, r2})
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the GetUploads method of
|
|
// the parent MockUploadServiceForExpiration instance is invoked and the
|
|
// hook queue is empty.
|
|
func (f *UploadServiceForExpirationGetUploadsFunc) SetDefaultHook(hook func(context.Context, shared.GetUploadsOptions) ([]types.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 MockUploadServiceForExpiration 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 *UploadServiceForExpirationGetUploadsFunc) PushHook(hook func(context.Context, shared.GetUploadsOptions) ([]types.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 *UploadServiceForExpirationGetUploadsFunc) SetDefaultReturn(r0 []types.Upload, r1 int, r2 error) {
|
|
f.SetDefaultHook(func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
// PushReturn calls PushHook with a function that returns the given values.
|
|
func (f *UploadServiceForExpirationGetUploadsFunc) PushReturn(r0 []types.Upload, r1 int, r2 error) {
|
|
f.PushHook(func(context.Context, shared.GetUploadsOptions) ([]types.Upload, int, error) {
|
|
return r0, r1, r2
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForExpirationGetUploadsFunc) nextHook() func(context.Context, shared.GetUploadsOptions) ([]types.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 *UploadServiceForExpirationGetUploadsFunc) appendCall(r0 UploadServiceForExpirationGetUploadsFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForExpirationGetUploadsFuncCall objects describing the
|
|
// invocations of this function.
|
|
func (f *UploadServiceForExpirationGetUploadsFunc) History() []UploadServiceForExpirationGetUploadsFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForExpirationGetUploadsFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForExpirationGetUploadsFuncCall is an object that describes
|
|
// an invocation of method GetUploads on an instance of
|
|
// MockUploadServiceForExpiration.
|
|
type UploadServiceForExpirationGetUploadsFuncCall 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 []types.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 UploadServiceForExpirationGetUploadsFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForExpirationGetUploadsFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1, c.Result2}
|
|
}
|
|
|
|
// UploadServiceForExpirationSetRepositoriesForRetentionScanFunc describes
|
|
// the behavior when the SetRepositoriesForRetentionScan method of the
|
|
// parent MockUploadServiceForExpiration instance is invoked.
|
|
type UploadServiceForExpirationSetRepositoriesForRetentionScanFunc struct {
|
|
defaultHook func(context.Context, time.Duration, int) ([]int, error)
|
|
hooks []func(context.Context, time.Duration, int) ([]int, error)
|
|
history []UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall
|
|
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 *MockUploadServiceForExpiration) SetRepositoriesForRetentionScan(v0 context.Context, v1 time.Duration, v2 int) ([]int, error) {
|
|
r0, r1 := m.SetRepositoriesForRetentionScanFunc.nextHook()(v0, v1, v2)
|
|
m.SetRepositoriesForRetentionScanFunc.appendCall(UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall{v0, v1, v2, r0, r1})
|
|
return r0, r1
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// SetRepositoriesForRetentionScan method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked and the hook queue is
|
|
// empty.
|
|
func (f *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) 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
|
|
// MockUploadServiceForExpiration 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 *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) 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 *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) 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 *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) PushReturn(r0 []int, r1 error) {
|
|
f.PushHook(func(context.Context, time.Duration, int) ([]int, error) {
|
|
return r0, r1
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) 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 *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) appendCall(r0 UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForExpirationSetRepositoriesForRetentionScanFunc) History() []UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall is an
|
|
// object that describes an invocation of method
|
|
// SetRepositoriesForRetentionScan on an instance of
|
|
// MockUploadServiceForExpiration.
|
|
type UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall 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 UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForExpirationSetRepositoriesForRetentionScanFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0, c.Result1}
|
|
}
|
|
|
|
// UploadServiceForExpirationUpdateUploadRetentionFunc describes the
|
|
// behavior when the UpdateUploadRetention method of the parent
|
|
// MockUploadServiceForExpiration instance is invoked.
|
|
type UploadServiceForExpirationUpdateUploadRetentionFunc struct {
|
|
defaultHook func(context.Context, []int, []int) error
|
|
hooks []func(context.Context, []int, []int) error
|
|
history []UploadServiceForExpirationUpdateUploadRetentionFuncCall
|
|
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 *MockUploadServiceForExpiration) UpdateUploadRetention(v0 context.Context, v1 []int, v2 []int) error {
|
|
r0 := m.UpdateUploadRetentionFunc.nextHook()(v0, v1, v2)
|
|
m.UpdateUploadRetentionFunc.appendCall(UploadServiceForExpirationUpdateUploadRetentionFuncCall{v0, v1, v2, r0})
|
|
return r0
|
|
}
|
|
|
|
// SetDefaultHook sets function that is called when the
|
|
// UpdateUploadRetention method of the parent MockUploadServiceForExpiration
|
|
// instance is invoked and the hook queue is empty.
|
|
func (f *UploadServiceForExpirationUpdateUploadRetentionFunc) 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 MockUploadServiceForExpiration
|
|
// 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 *UploadServiceForExpirationUpdateUploadRetentionFunc) 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 *UploadServiceForExpirationUpdateUploadRetentionFunc) 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 *UploadServiceForExpirationUpdateUploadRetentionFunc) PushReturn(r0 error) {
|
|
f.PushHook(func(context.Context, []int, []int) error {
|
|
return r0
|
|
})
|
|
}
|
|
|
|
func (f *UploadServiceForExpirationUpdateUploadRetentionFunc) 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 *UploadServiceForExpirationUpdateUploadRetentionFunc) appendCall(r0 UploadServiceForExpirationUpdateUploadRetentionFuncCall) {
|
|
f.mutex.Lock()
|
|
f.history = append(f.history, r0)
|
|
f.mutex.Unlock()
|
|
}
|
|
|
|
// History returns a sequence of
|
|
// UploadServiceForExpirationUpdateUploadRetentionFuncCall objects
|
|
// describing the invocations of this function.
|
|
func (f *UploadServiceForExpirationUpdateUploadRetentionFunc) History() []UploadServiceForExpirationUpdateUploadRetentionFuncCall {
|
|
f.mutex.Lock()
|
|
history := make([]UploadServiceForExpirationUpdateUploadRetentionFuncCall, len(f.history))
|
|
copy(history, f.history)
|
|
f.mutex.Unlock()
|
|
|
|
return history
|
|
}
|
|
|
|
// UploadServiceForExpirationUpdateUploadRetentionFuncCall is an object that
|
|
// describes an invocation of method UpdateUploadRetention on an instance of
|
|
// MockUploadServiceForExpiration.
|
|
type UploadServiceForExpirationUpdateUploadRetentionFuncCall 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 UploadServiceForExpirationUpdateUploadRetentionFuncCall) Args() []interface{} {
|
|
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
|
|
}
|
|
|
|
// Results returns an interface slice containing the results of this
|
|
// invocation.
|
|
func (c UploadServiceForExpirationUpdateUploadRetentionFuncCall) Results() []interface{} {
|
|
return []interface{}{c.Result0}
|
|
}
|