sourcegraph/internal/codeintel/autoindexing/mocks_test.go
Varun Gandhi a6b6844678
chore: Rename Index -> AutoIndexJob (#63955)
Also renames a bunch of related types such as
- config.IndexJob -> config.AutoIndexJobSpec
- IndexLoader -> AutoIndexJobLoader

and so on.
2024-07-22 22:18:40 +08:00

3158 lines
114 KiB
Go
Generated

// Code generated by go-mockgen 1.3.7; DO NOT EDIT.
//
// This file was generated by running `sg generate` (or `go-mockgen`) at the root of
// this repository. To add additional mocks to this or another package, add a new entry
// to the mockgen.yaml file in the root of this repository.
package autoindexing
import (
"context"
"sync"
"time"
api "github.com/sourcegraph/sourcegraph/internal/api"
store "github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/store"
shared "github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/shared"
shared1 "github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/shared"
)
// MockStore is a mock implementation of the Store interface (from the
// package
// github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/store)
// used for unit testing.
type MockStore struct {
// GetIndexConfigurationByRepositoryIDFunc is an instance of a mock
// function object controlling the behavior of the method
// GetIndexConfigurationByRepositoryID.
GetIndexConfigurationByRepositoryIDFunc *StoreGetIndexConfigurationByRepositoryIDFunc
// GetInferenceScriptFunc is an instance of a mock function object
// controlling the behavior of the method GetInferenceScript.
GetInferenceScriptFunc *StoreGetInferenceScriptFunc
// GetLastIndexScanForRepositoryFunc is an instance of a mock function
// object controlling the behavior of the method
// GetLastIndexScanForRepository.
GetLastIndexScanForRepositoryFunc *StoreGetLastIndexScanForRepositoryFunc
// GetQueuedRepoRevFunc is an instance of a mock function object
// controlling the behavior of the method GetQueuedRepoRev.
GetQueuedRepoRevFunc *StoreGetQueuedRepoRevFunc
// InsertDependencyIndexingJobFunc is an instance of a mock function
// object controlling the behavior of the method
// InsertDependencyIndexingJob.
InsertDependencyIndexingJobFunc *StoreInsertDependencyIndexingJobFunc
// InsertJobsFunc is an instance of a mock function object controlling
// the behavior of the method InsertJobs.
InsertJobsFunc *StoreInsertJobsFunc
// IsQueuedFunc is an instance of a mock function object controlling the
// behavior of the method IsQueued.
IsQueuedFunc *StoreIsQueuedFunc
// IsQueuedRootIndexerFunc is an instance of a mock function object
// controlling the behavior of the method IsQueuedRootIndexer.
IsQueuedRootIndexerFunc *StoreIsQueuedRootIndexerFunc
// MarkRepoRevsAsProcessedFunc is an instance of a mock function object
// controlling the behavior of the method MarkRepoRevsAsProcessed.
MarkRepoRevsAsProcessedFunc *StoreMarkRepoRevsAsProcessedFunc
// QueueRepoRevFunc is an instance of a mock function object controlling
// the behavior of the method QueueRepoRev.
QueueRepoRevFunc *StoreQueueRepoRevFunc
// RepositoryExceptionsFunc is an instance of a mock function object
// controlling the behavior of the method RepositoryExceptions.
RepositoryExceptionsFunc *StoreRepositoryExceptionsFunc
// RepositoryIDsWithConfigurationFunc is an instance of a mock function
// object controlling the behavior of the method
// RepositoryIDsWithConfiguration.
RepositoryIDsWithConfigurationFunc *StoreRepositoryIDsWithConfigurationFunc
// SetConfigurationSummaryFunc is an instance of a mock function object
// controlling the behavior of the method SetConfigurationSummary.
SetConfigurationSummaryFunc *StoreSetConfigurationSummaryFunc
// SetInferenceScriptFunc is an instance of a mock function object
// controlling the behavior of the method SetInferenceScript.
SetInferenceScriptFunc *StoreSetInferenceScriptFunc
// SetRepositoryExceptionsFunc is an instance of a mock function object
// controlling the behavior of the method SetRepositoryExceptions.
SetRepositoryExceptionsFunc *StoreSetRepositoryExceptionsFunc
// TopRepositoriesToConfigureFunc is an instance of a mock function
// object controlling the behavior of the method
// TopRepositoriesToConfigure.
TopRepositoriesToConfigureFunc *StoreTopRepositoriesToConfigureFunc
// TruncateConfigurationSummaryFunc is an instance of a mock function
// object controlling the behavior of the method
// TruncateConfigurationSummary.
TruncateConfigurationSummaryFunc *StoreTruncateConfigurationSummaryFunc
// UpdateIndexConfigurationByRepositoryIDFunc is an instance of a mock
// function object controlling the behavior of the method
// UpdateIndexConfigurationByRepositoryID.
UpdateIndexConfigurationByRepositoryIDFunc *StoreUpdateIndexConfigurationByRepositoryIDFunc
// WithTransactionFunc is an instance of a mock function object
// controlling the behavior of the method WithTransaction.
WithTransactionFunc *StoreWithTransactionFunc
}
// NewMockStore creates a new mock of the Store interface. All methods
// return zero values for all results, unless overwritten.
func NewMockStore() *MockStore {
return &MockStore{
GetIndexConfigurationByRepositoryIDFunc: &StoreGetIndexConfigurationByRepositoryIDFunc{
defaultHook: func(context.Context, int) (r0 shared.IndexConfiguration, r1 bool, r2 error) {
return
},
},
GetInferenceScriptFunc: &StoreGetInferenceScriptFunc{
defaultHook: func(context.Context) (r0 string, r1 error) {
return
},
},
GetLastIndexScanForRepositoryFunc: &StoreGetLastIndexScanForRepositoryFunc{
defaultHook: func(context.Context, int) (r0 *time.Time, r1 error) {
return
},
},
GetQueuedRepoRevFunc: &StoreGetQueuedRepoRevFunc{
defaultHook: func(context.Context, int) (r0 []store.RepoRev, r1 error) {
return
},
},
InsertDependencyIndexingJobFunc: &StoreInsertDependencyIndexingJobFunc{
defaultHook: func(context.Context, int, string, time.Time) (r0 int, r1 error) {
return
},
},
InsertJobsFunc: &StoreInsertJobsFunc{
defaultHook: func(context.Context, []shared1.AutoIndexJob) (r0 []shared1.AutoIndexJob, r1 error) {
return
},
},
IsQueuedFunc: &StoreIsQueuedFunc{
defaultHook: func(context.Context, int, string) (r0 bool, r1 error) {
return
},
},
IsQueuedRootIndexerFunc: &StoreIsQueuedRootIndexerFunc{
defaultHook: func(context.Context, int, string, string, string) (r0 bool, r1 error) {
return
},
},
MarkRepoRevsAsProcessedFunc: &StoreMarkRepoRevsAsProcessedFunc{
defaultHook: func(context.Context, []int) (r0 error) {
return
},
},
QueueRepoRevFunc: &StoreQueueRepoRevFunc{
defaultHook: func(context.Context, int, string) (r0 error) {
return
},
},
RepositoryExceptionsFunc: &StoreRepositoryExceptionsFunc{
defaultHook: func(context.Context, int) (r0 bool, r1 bool, r2 error) {
return
},
},
RepositoryIDsWithConfigurationFunc: &StoreRepositoryIDsWithConfigurationFunc{
defaultHook: func(context.Context, int, int) (r0 []shared1.RepositoryWithAvailableIndexers, r1 int, r2 error) {
return
},
},
SetConfigurationSummaryFunc: &StoreSetConfigurationSummaryFunc{
defaultHook: func(context.Context, int, int, map[string]shared1.AvailableIndexer) (r0 error) {
return
},
},
SetInferenceScriptFunc: &StoreSetInferenceScriptFunc{
defaultHook: func(context.Context, string) (r0 error) {
return
},
},
SetRepositoryExceptionsFunc: &StoreSetRepositoryExceptionsFunc{
defaultHook: func(context.Context, int, bool, bool) (r0 error) {
return
},
},
TopRepositoriesToConfigureFunc: &StoreTopRepositoriesToConfigureFunc{
defaultHook: func(context.Context, int) (r0 []shared1.RepositoryWithCount, r1 error) {
return
},
},
TruncateConfigurationSummaryFunc: &StoreTruncateConfigurationSummaryFunc{
defaultHook: func(context.Context, int) (r0 error) {
return
},
},
UpdateIndexConfigurationByRepositoryIDFunc: &StoreUpdateIndexConfigurationByRepositoryIDFunc{
defaultHook: func(context.Context, int, []byte) (r0 error) {
return
},
},
WithTransactionFunc: &StoreWithTransactionFunc{
defaultHook: func(context.Context, func(tx store.Store) error) (r0 error) {
return
},
},
}
}
// NewStrictMockStore creates a new mock of the Store interface. All methods
// panic on invocation, unless overwritten.
func NewStrictMockStore() *MockStore {
return &MockStore{
GetIndexConfigurationByRepositoryIDFunc: &StoreGetIndexConfigurationByRepositoryIDFunc{
defaultHook: func(context.Context, int) (shared.IndexConfiguration, bool, error) {
panic("unexpected invocation of MockStore.GetIndexConfigurationByRepositoryID")
},
},
GetInferenceScriptFunc: &StoreGetInferenceScriptFunc{
defaultHook: func(context.Context) (string, error) {
panic("unexpected invocation of MockStore.GetInferenceScript")
},
},
GetLastIndexScanForRepositoryFunc: &StoreGetLastIndexScanForRepositoryFunc{
defaultHook: func(context.Context, int) (*time.Time, error) {
panic("unexpected invocation of MockStore.GetLastIndexScanForRepository")
},
},
GetQueuedRepoRevFunc: &StoreGetQueuedRepoRevFunc{
defaultHook: func(context.Context, int) ([]store.RepoRev, error) {
panic("unexpected invocation of MockStore.GetQueuedRepoRev")
},
},
InsertDependencyIndexingJobFunc: &StoreInsertDependencyIndexingJobFunc{
defaultHook: func(context.Context, int, string, time.Time) (int, error) {
panic("unexpected invocation of MockStore.InsertDependencyIndexingJob")
},
},
InsertJobsFunc: &StoreInsertJobsFunc{
defaultHook: func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error) {
panic("unexpected invocation of MockStore.InsertJobs")
},
},
IsQueuedFunc: &StoreIsQueuedFunc{
defaultHook: func(context.Context, int, string) (bool, error) {
panic("unexpected invocation of MockStore.IsQueued")
},
},
IsQueuedRootIndexerFunc: &StoreIsQueuedRootIndexerFunc{
defaultHook: func(context.Context, int, string, string, string) (bool, error) {
panic("unexpected invocation of MockStore.IsQueuedRootIndexer")
},
},
MarkRepoRevsAsProcessedFunc: &StoreMarkRepoRevsAsProcessedFunc{
defaultHook: func(context.Context, []int) error {
panic("unexpected invocation of MockStore.MarkRepoRevsAsProcessed")
},
},
QueueRepoRevFunc: &StoreQueueRepoRevFunc{
defaultHook: func(context.Context, int, string) error {
panic("unexpected invocation of MockStore.QueueRepoRev")
},
},
RepositoryExceptionsFunc: &StoreRepositoryExceptionsFunc{
defaultHook: func(context.Context, int) (bool, bool, error) {
panic("unexpected invocation of MockStore.RepositoryExceptions")
},
},
RepositoryIDsWithConfigurationFunc: &StoreRepositoryIDsWithConfigurationFunc{
defaultHook: func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error) {
panic("unexpected invocation of MockStore.RepositoryIDsWithConfiguration")
},
},
SetConfigurationSummaryFunc: &StoreSetConfigurationSummaryFunc{
defaultHook: func(context.Context, int, int, map[string]shared1.AvailableIndexer) error {
panic("unexpected invocation of MockStore.SetConfigurationSummary")
},
},
SetInferenceScriptFunc: &StoreSetInferenceScriptFunc{
defaultHook: func(context.Context, string) error {
panic("unexpected invocation of MockStore.SetInferenceScript")
},
},
SetRepositoryExceptionsFunc: &StoreSetRepositoryExceptionsFunc{
defaultHook: func(context.Context, int, bool, bool) error {
panic("unexpected invocation of MockStore.SetRepositoryExceptions")
},
},
TopRepositoriesToConfigureFunc: &StoreTopRepositoriesToConfigureFunc{
defaultHook: func(context.Context, int) ([]shared1.RepositoryWithCount, error) {
panic("unexpected invocation of MockStore.TopRepositoriesToConfigure")
},
},
TruncateConfigurationSummaryFunc: &StoreTruncateConfigurationSummaryFunc{
defaultHook: func(context.Context, int) error {
panic("unexpected invocation of MockStore.TruncateConfigurationSummary")
},
},
UpdateIndexConfigurationByRepositoryIDFunc: &StoreUpdateIndexConfigurationByRepositoryIDFunc{
defaultHook: func(context.Context, int, []byte) error {
panic("unexpected invocation of MockStore.UpdateIndexConfigurationByRepositoryID")
},
},
WithTransactionFunc: &StoreWithTransactionFunc{
defaultHook: func(context.Context, func(tx store.Store) error) error {
panic("unexpected invocation of MockStore.WithTransaction")
},
},
}
}
// 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{
GetIndexConfigurationByRepositoryIDFunc: &StoreGetIndexConfigurationByRepositoryIDFunc{
defaultHook: i.GetIndexConfigurationByRepositoryID,
},
GetInferenceScriptFunc: &StoreGetInferenceScriptFunc{
defaultHook: i.GetInferenceScript,
},
GetLastIndexScanForRepositoryFunc: &StoreGetLastIndexScanForRepositoryFunc{
defaultHook: i.GetLastIndexScanForRepository,
},
GetQueuedRepoRevFunc: &StoreGetQueuedRepoRevFunc{
defaultHook: i.GetQueuedRepoRev,
},
InsertDependencyIndexingJobFunc: &StoreInsertDependencyIndexingJobFunc{
defaultHook: i.InsertDependencyIndexingJob,
},
InsertJobsFunc: &StoreInsertJobsFunc{
defaultHook: i.InsertJobs,
},
IsQueuedFunc: &StoreIsQueuedFunc{
defaultHook: i.IsQueued,
},
IsQueuedRootIndexerFunc: &StoreIsQueuedRootIndexerFunc{
defaultHook: i.IsQueuedRootIndexer,
},
MarkRepoRevsAsProcessedFunc: &StoreMarkRepoRevsAsProcessedFunc{
defaultHook: i.MarkRepoRevsAsProcessed,
},
QueueRepoRevFunc: &StoreQueueRepoRevFunc{
defaultHook: i.QueueRepoRev,
},
RepositoryExceptionsFunc: &StoreRepositoryExceptionsFunc{
defaultHook: i.RepositoryExceptions,
},
RepositoryIDsWithConfigurationFunc: &StoreRepositoryIDsWithConfigurationFunc{
defaultHook: i.RepositoryIDsWithConfiguration,
},
SetConfigurationSummaryFunc: &StoreSetConfigurationSummaryFunc{
defaultHook: i.SetConfigurationSummary,
},
SetInferenceScriptFunc: &StoreSetInferenceScriptFunc{
defaultHook: i.SetInferenceScript,
},
SetRepositoryExceptionsFunc: &StoreSetRepositoryExceptionsFunc{
defaultHook: i.SetRepositoryExceptions,
},
TopRepositoriesToConfigureFunc: &StoreTopRepositoriesToConfigureFunc{
defaultHook: i.TopRepositoriesToConfigure,
},
TruncateConfigurationSummaryFunc: &StoreTruncateConfigurationSummaryFunc{
defaultHook: i.TruncateConfigurationSummary,
},
UpdateIndexConfigurationByRepositoryIDFunc: &StoreUpdateIndexConfigurationByRepositoryIDFunc{
defaultHook: i.UpdateIndexConfigurationByRepositoryID,
},
WithTransactionFunc: &StoreWithTransactionFunc{
defaultHook: i.WithTransaction,
},
}
}
// StoreGetIndexConfigurationByRepositoryIDFunc describes the behavior when
// the GetIndexConfigurationByRepositoryID method of the parent MockStore
// instance is invoked.
type StoreGetIndexConfigurationByRepositoryIDFunc struct {
defaultHook func(context.Context, int) (shared.IndexConfiguration, bool, error)
hooks []func(context.Context, int) (shared.IndexConfiguration, bool, error)
history []StoreGetIndexConfigurationByRepositoryIDFuncCall
mutex sync.Mutex
}
// GetIndexConfigurationByRepositoryID delegates to the next hook function
// in the queue and stores the parameter and result values of this
// invocation.
func (m *MockStore) GetIndexConfigurationByRepositoryID(v0 context.Context, v1 int) (shared.IndexConfiguration, bool, error) {
r0, r1, r2 := m.GetIndexConfigurationByRepositoryIDFunc.nextHook()(v0, v1)
m.GetIndexConfigurationByRepositoryIDFunc.appendCall(StoreGetIndexConfigurationByRepositoryIDFuncCall{v0, v1, r0, r1, r2})
return r0, r1, r2
}
// SetDefaultHook sets function that is called when the
// GetIndexConfigurationByRepositoryID method of the parent MockStore
// instance is invoked and the hook queue is empty.
func (f *StoreGetIndexConfigurationByRepositoryIDFunc) SetDefaultHook(hook func(context.Context, int) (shared.IndexConfiguration, bool, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetIndexConfigurationByRepositoryID 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 *StoreGetIndexConfigurationByRepositoryIDFunc) PushHook(hook func(context.Context, int) (shared.IndexConfiguration, 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 *StoreGetIndexConfigurationByRepositoryIDFunc) SetDefaultReturn(r0 shared.IndexConfiguration, r1 bool, r2 error) {
f.SetDefaultHook(func(context.Context, int) (shared.IndexConfiguration, bool, error) {
return r0, r1, r2
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreGetIndexConfigurationByRepositoryIDFunc) PushReturn(r0 shared.IndexConfiguration, r1 bool, r2 error) {
f.PushHook(func(context.Context, int) (shared.IndexConfiguration, bool, error) {
return r0, r1, r2
})
}
func (f *StoreGetIndexConfigurationByRepositoryIDFunc) nextHook() func(context.Context, int) (shared.IndexConfiguration, 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 *StoreGetIndexConfigurationByRepositoryIDFunc) appendCall(r0 StoreGetIndexConfigurationByRepositoryIDFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of
// StoreGetIndexConfigurationByRepositoryIDFuncCall objects describing the
// invocations of this function.
func (f *StoreGetIndexConfigurationByRepositoryIDFunc) History() []StoreGetIndexConfigurationByRepositoryIDFuncCall {
f.mutex.Lock()
history := make([]StoreGetIndexConfigurationByRepositoryIDFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreGetIndexConfigurationByRepositoryIDFuncCall is an object that
// describes an invocation of method GetIndexConfigurationByRepositoryID on
// an instance of MockStore.
type StoreGetIndexConfigurationByRepositoryIDFuncCall struct {
// Arg0 is the value of the 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.IndexConfiguration
// 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 StoreGetIndexConfigurationByRepositoryIDFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreGetIndexConfigurationByRepositoryIDFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1, c.Result2}
}
// StoreGetInferenceScriptFunc describes the behavior when the
// GetInferenceScript method of the parent MockStore instance is invoked.
type StoreGetInferenceScriptFunc struct {
defaultHook func(context.Context) (string, error)
hooks []func(context.Context) (string, error)
history []StoreGetInferenceScriptFuncCall
mutex sync.Mutex
}
// GetInferenceScript delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) GetInferenceScript(v0 context.Context) (string, error) {
r0, r1 := m.GetInferenceScriptFunc.nextHook()(v0)
m.GetInferenceScriptFunc.appendCall(StoreGetInferenceScriptFuncCall{v0, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the GetInferenceScript
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreGetInferenceScriptFunc) SetDefaultHook(hook func(context.Context) (string, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetInferenceScript 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 *StoreGetInferenceScriptFunc) PushHook(hook func(context.Context) (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 *StoreGetInferenceScriptFunc) SetDefaultReturn(r0 string, r1 error) {
f.SetDefaultHook(func(context.Context) (string, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreGetInferenceScriptFunc) PushReturn(r0 string, r1 error) {
f.PushHook(func(context.Context) (string, error) {
return r0, r1
})
}
func (f *StoreGetInferenceScriptFunc) nextHook() func(context.Context) (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 *StoreGetInferenceScriptFunc) appendCall(r0 StoreGetInferenceScriptFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreGetInferenceScriptFuncCall objects
// describing the invocations of this function.
func (f *StoreGetInferenceScriptFunc) History() []StoreGetInferenceScriptFuncCall {
f.mutex.Lock()
history := make([]StoreGetInferenceScriptFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreGetInferenceScriptFuncCall is an object that describes an invocation
// of method GetInferenceScript on an instance of MockStore.
type StoreGetInferenceScriptFuncCall 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 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 StoreGetInferenceScriptFuncCall) Args() []interface{} {
return []interface{}{c.Arg0}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreGetInferenceScriptFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreGetLastIndexScanForRepositoryFunc describes the behavior when the
// GetLastIndexScanForRepository method of the parent MockStore instance is
// invoked.
type StoreGetLastIndexScanForRepositoryFunc struct {
defaultHook func(context.Context, int) (*time.Time, error)
hooks []func(context.Context, int) (*time.Time, error)
history []StoreGetLastIndexScanForRepositoryFuncCall
mutex sync.Mutex
}
// GetLastIndexScanForRepository delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockStore) GetLastIndexScanForRepository(v0 context.Context, v1 int) (*time.Time, error) {
r0, r1 := m.GetLastIndexScanForRepositoryFunc.nextHook()(v0, v1)
m.GetLastIndexScanForRepositoryFunc.appendCall(StoreGetLastIndexScanForRepositoryFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the
// GetLastIndexScanForRepository method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreGetLastIndexScanForRepositoryFunc) 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
// GetLastIndexScanForRepository 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 *StoreGetLastIndexScanForRepositoryFunc) 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 *StoreGetLastIndexScanForRepositoryFunc) 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 *StoreGetLastIndexScanForRepositoryFunc) PushReturn(r0 *time.Time, r1 error) {
f.PushHook(func(context.Context, int) (*time.Time, error) {
return r0, r1
})
}
func (f *StoreGetLastIndexScanForRepositoryFunc) 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 *StoreGetLastIndexScanForRepositoryFunc) appendCall(r0 StoreGetLastIndexScanForRepositoryFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreGetLastIndexScanForRepositoryFuncCall
// objects describing the invocations of this function.
func (f *StoreGetLastIndexScanForRepositoryFunc) History() []StoreGetLastIndexScanForRepositoryFuncCall {
f.mutex.Lock()
history := make([]StoreGetLastIndexScanForRepositoryFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreGetLastIndexScanForRepositoryFuncCall is an object that describes an
// invocation of method GetLastIndexScanForRepository on an instance of
// MockStore.
type StoreGetLastIndexScanForRepositoryFuncCall struct {
// Arg0 is the value of the 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 StoreGetLastIndexScanForRepositoryFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreGetLastIndexScanForRepositoryFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreGetQueuedRepoRevFunc describes the behavior when the
// GetQueuedRepoRev method of the parent MockStore instance is invoked.
type StoreGetQueuedRepoRevFunc struct {
defaultHook func(context.Context, int) ([]store.RepoRev, error)
hooks []func(context.Context, int) ([]store.RepoRev, error)
history []StoreGetQueuedRepoRevFuncCall
mutex sync.Mutex
}
// GetQueuedRepoRev delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) GetQueuedRepoRev(v0 context.Context, v1 int) ([]store.RepoRev, error) {
r0, r1 := m.GetQueuedRepoRevFunc.nextHook()(v0, v1)
m.GetQueuedRepoRevFunc.appendCall(StoreGetQueuedRepoRevFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the GetQueuedRepoRev
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreGetQueuedRepoRevFunc) SetDefaultHook(hook func(context.Context, int) ([]store.RepoRev, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetQueuedRepoRev 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 *StoreGetQueuedRepoRevFunc) PushHook(hook func(context.Context, int) ([]store.RepoRev, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *StoreGetQueuedRepoRevFunc) SetDefaultReturn(r0 []store.RepoRev, r1 error) {
f.SetDefaultHook(func(context.Context, int) ([]store.RepoRev, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreGetQueuedRepoRevFunc) PushReturn(r0 []store.RepoRev, r1 error) {
f.PushHook(func(context.Context, int) ([]store.RepoRev, error) {
return r0, r1
})
}
func (f *StoreGetQueuedRepoRevFunc) nextHook() func(context.Context, int) ([]store.RepoRev, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *StoreGetQueuedRepoRevFunc) appendCall(r0 StoreGetQueuedRepoRevFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreGetQueuedRepoRevFuncCall objects
// describing the invocations of this function.
func (f *StoreGetQueuedRepoRevFunc) History() []StoreGetQueuedRepoRevFuncCall {
f.mutex.Lock()
history := make([]StoreGetQueuedRepoRevFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreGetQueuedRepoRevFuncCall is an object that describes an invocation
// of method GetQueuedRepoRev on an instance of MockStore.
type StoreGetQueuedRepoRevFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []store.RepoRev
// 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 StoreGetQueuedRepoRevFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreGetQueuedRepoRevFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreInsertDependencyIndexingJobFunc describes the behavior when the
// InsertDependencyIndexingJob method of the parent MockStore instance is
// invoked.
type StoreInsertDependencyIndexingJobFunc struct {
defaultHook func(context.Context, int, string, time.Time) (int, error)
hooks []func(context.Context, int, string, time.Time) (int, error)
history []StoreInsertDependencyIndexingJobFuncCall
mutex sync.Mutex
}
// InsertDependencyIndexingJob delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockStore) InsertDependencyIndexingJob(v0 context.Context, v1 int, v2 string, v3 time.Time) (int, error) {
r0, r1 := m.InsertDependencyIndexingJobFunc.nextHook()(v0, v1, v2, v3)
m.InsertDependencyIndexingJobFunc.appendCall(StoreInsertDependencyIndexingJobFuncCall{v0, v1, v2, v3, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the
// InsertDependencyIndexingJob method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreInsertDependencyIndexingJobFunc) 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
// InsertDependencyIndexingJob 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 *StoreInsertDependencyIndexingJobFunc) 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 *StoreInsertDependencyIndexingJobFunc) 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 *StoreInsertDependencyIndexingJobFunc) PushReturn(r0 int, r1 error) {
f.PushHook(func(context.Context, int, string, time.Time) (int, error) {
return r0, r1
})
}
func (f *StoreInsertDependencyIndexingJobFunc) 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 *StoreInsertDependencyIndexingJobFunc) appendCall(r0 StoreInsertDependencyIndexingJobFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreInsertDependencyIndexingJobFuncCall
// objects describing the invocations of this function.
func (f *StoreInsertDependencyIndexingJobFunc) History() []StoreInsertDependencyIndexingJobFuncCall {
f.mutex.Lock()
history := make([]StoreInsertDependencyIndexingJobFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreInsertDependencyIndexingJobFuncCall is an object that describes an
// invocation of method InsertDependencyIndexingJob on an instance of
// MockStore.
type StoreInsertDependencyIndexingJobFuncCall struct {
// Arg0 is the value of the 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 StoreInsertDependencyIndexingJobFuncCall) 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 StoreInsertDependencyIndexingJobFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreInsertJobsFunc describes the behavior when the InsertJobs method of
// the parent MockStore instance is invoked.
type StoreInsertJobsFunc struct {
defaultHook func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error)
hooks []func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error)
history []StoreInsertJobsFuncCall
mutex sync.Mutex
}
// InsertJobs delegates to the next hook function in the queue and stores
// the parameter and result values of this invocation.
func (m *MockStore) InsertJobs(v0 context.Context, v1 []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error) {
r0, r1 := m.InsertJobsFunc.nextHook()(v0, v1)
m.InsertJobsFunc.appendCall(StoreInsertJobsFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the InsertJobs method of
// the parent MockStore instance is invoked and the hook queue is empty.
func (f *StoreInsertJobsFunc) SetDefaultHook(hook func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// InsertJobs 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 *StoreInsertJobsFunc) PushHook(hook func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *StoreInsertJobsFunc) SetDefaultReturn(r0 []shared1.AutoIndexJob, r1 error) {
f.SetDefaultHook(func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreInsertJobsFunc) PushReturn(r0 []shared1.AutoIndexJob, r1 error) {
f.PushHook(func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error) {
return r0, r1
})
}
func (f *StoreInsertJobsFunc) nextHook() func(context.Context, []shared1.AutoIndexJob) ([]shared1.AutoIndexJob, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *StoreInsertJobsFunc) appendCall(r0 StoreInsertJobsFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreInsertJobsFuncCall objects describing
// the invocations of this function.
func (f *StoreInsertJobsFunc) History() []StoreInsertJobsFuncCall {
f.mutex.Lock()
history := make([]StoreInsertJobsFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreInsertJobsFuncCall is an object that describes an invocation of
// method InsertJobs on an instance of MockStore.
type StoreInsertJobsFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 []shared1.AutoIndexJob
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []shared1.AutoIndexJob
// Result1 is the value of the 2nd result returned from this method
// invocation.
Result1 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c StoreInsertJobsFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreInsertJobsFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreIsQueuedFunc describes the behavior when the IsQueued method of the
// parent MockStore instance is invoked.
type StoreIsQueuedFunc struct {
defaultHook func(context.Context, int, string) (bool, error)
hooks []func(context.Context, int, string) (bool, error)
history []StoreIsQueuedFuncCall
mutex sync.Mutex
}
// IsQueued delegates to the next hook function in the queue and stores the
// parameter and result values of this invocation.
func (m *MockStore) IsQueued(v0 context.Context, v1 int, v2 string) (bool, error) {
r0, r1 := m.IsQueuedFunc.nextHook()(v0, v1, v2)
m.IsQueuedFunc.appendCall(StoreIsQueuedFuncCall{v0, v1, v2, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the IsQueued method of
// the parent MockStore instance is invoked and the hook queue is empty.
func (f *StoreIsQueuedFunc) 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
// IsQueued 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 *StoreIsQueuedFunc) 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 *StoreIsQueuedFunc) 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 *StoreIsQueuedFunc) PushReturn(r0 bool, r1 error) {
f.PushHook(func(context.Context, int, string) (bool, error) {
return r0, r1
})
}
func (f *StoreIsQueuedFunc) 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 *StoreIsQueuedFunc) appendCall(r0 StoreIsQueuedFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreIsQueuedFuncCall objects describing
// the invocations of this function.
func (f *StoreIsQueuedFunc) History() []StoreIsQueuedFuncCall {
f.mutex.Lock()
history := make([]StoreIsQueuedFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreIsQueuedFuncCall is an object that describes an invocation of method
// IsQueued on an instance of MockStore.
type StoreIsQueuedFuncCall struct {
// Arg0 is the value of the 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 StoreIsQueuedFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreIsQueuedFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreIsQueuedRootIndexerFunc describes the behavior when the
// IsQueuedRootIndexer method of the parent MockStore instance is invoked.
type StoreIsQueuedRootIndexerFunc struct {
defaultHook func(context.Context, int, string, string, string) (bool, error)
hooks []func(context.Context, int, string, string, string) (bool, error)
history []StoreIsQueuedRootIndexerFuncCall
mutex sync.Mutex
}
// IsQueuedRootIndexer delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) IsQueuedRootIndexer(v0 context.Context, v1 int, v2 string, v3 string, v4 string) (bool, error) {
r0, r1 := m.IsQueuedRootIndexerFunc.nextHook()(v0, v1, v2, v3, v4)
m.IsQueuedRootIndexerFunc.appendCall(StoreIsQueuedRootIndexerFuncCall{v0, v1, v2, v3, v4, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the IsQueuedRootIndexer
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreIsQueuedRootIndexerFunc) SetDefaultHook(hook func(context.Context, int, string, string, string) (bool, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// IsQueuedRootIndexer 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 *StoreIsQueuedRootIndexerFunc) PushHook(hook func(context.Context, int, string, 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 *StoreIsQueuedRootIndexerFunc) SetDefaultReturn(r0 bool, r1 error) {
f.SetDefaultHook(func(context.Context, int, string, string, string) (bool, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreIsQueuedRootIndexerFunc) PushReturn(r0 bool, r1 error) {
f.PushHook(func(context.Context, int, string, string, string) (bool, error) {
return r0, r1
})
}
func (f *StoreIsQueuedRootIndexerFunc) nextHook() func(context.Context, int, string, 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 *StoreIsQueuedRootIndexerFunc) appendCall(r0 StoreIsQueuedRootIndexerFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreIsQueuedRootIndexerFuncCall objects
// describing the invocations of this function.
func (f *StoreIsQueuedRootIndexerFunc) History() []StoreIsQueuedRootIndexerFuncCall {
f.mutex.Lock()
history := make([]StoreIsQueuedRootIndexerFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreIsQueuedRootIndexerFuncCall is an object that describes an
// invocation of method IsQueuedRootIndexer on an instance of MockStore.
type StoreIsQueuedRootIndexerFuncCall struct {
// Arg0 is the value of the 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 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 StoreIsQueuedRootIndexerFuncCall) 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 StoreIsQueuedRootIndexerFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreMarkRepoRevsAsProcessedFunc describes the behavior when the
// MarkRepoRevsAsProcessed method of the parent MockStore instance is
// invoked.
type StoreMarkRepoRevsAsProcessedFunc struct {
defaultHook func(context.Context, []int) error
hooks []func(context.Context, []int) error
history []StoreMarkRepoRevsAsProcessedFuncCall
mutex sync.Mutex
}
// MarkRepoRevsAsProcessed delegates to the next hook function in the queue
// and stores the parameter and result values of this invocation.
func (m *MockStore) MarkRepoRevsAsProcessed(v0 context.Context, v1 []int) error {
r0 := m.MarkRepoRevsAsProcessedFunc.nextHook()(v0, v1)
m.MarkRepoRevsAsProcessedFunc.appendCall(StoreMarkRepoRevsAsProcessedFuncCall{v0, v1, r0})
return r0
}
// SetDefaultHook sets function that is called when the
// MarkRepoRevsAsProcessed method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreMarkRepoRevsAsProcessedFunc) SetDefaultHook(hook func(context.Context, []int) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// MarkRepoRevsAsProcessed 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 *StoreMarkRepoRevsAsProcessedFunc) 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 *StoreMarkRepoRevsAsProcessedFunc) 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 *StoreMarkRepoRevsAsProcessedFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, []int) error {
return r0
})
}
func (f *StoreMarkRepoRevsAsProcessedFunc) 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 *StoreMarkRepoRevsAsProcessedFunc) appendCall(r0 StoreMarkRepoRevsAsProcessedFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreMarkRepoRevsAsProcessedFuncCall
// objects describing the invocations of this function.
func (f *StoreMarkRepoRevsAsProcessedFunc) History() []StoreMarkRepoRevsAsProcessedFuncCall {
f.mutex.Lock()
history := make([]StoreMarkRepoRevsAsProcessedFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreMarkRepoRevsAsProcessedFuncCall is an object that describes an
// invocation of method MarkRepoRevsAsProcessed on an instance of MockStore.
type StoreMarkRepoRevsAsProcessedFuncCall struct {
// Arg0 is the value of the 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 StoreMarkRepoRevsAsProcessedFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreMarkRepoRevsAsProcessedFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreQueueRepoRevFunc describes the behavior when the QueueRepoRev method
// of the parent MockStore instance is invoked.
type StoreQueueRepoRevFunc struct {
defaultHook func(context.Context, int, string) error
hooks []func(context.Context, int, string) error
history []StoreQueueRepoRevFuncCall
mutex sync.Mutex
}
// QueueRepoRev delegates to the next hook function in the queue and stores
// the parameter and result values of this invocation.
func (m *MockStore) QueueRepoRev(v0 context.Context, v1 int, v2 string) error {
r0 := m.QueueRepoRevFunc.nextHook()(v0, v1, v2)
m.QueueRepoRevFunc.appendCall(StoreQueueRepoRevFuncCall{v0, v1, v2, r0})
return r0
}
// SetDefaultHook sets function that is called when the QueueRepoRev method
// of the parent MockStore instance is invoked and the hook queue is empty.
func (f *StoreQueueRepoRevFunc) 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
// QueueRepoRev 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 *StoreQueueRepoRevFunc) 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 *StoreQueueRepoRevFunc) 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 *StoreQueueRepoRevFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, int, string) error {
return r0
})
}
func (f *StoreQueueRepoRevFunc) 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 *StoreQueueRepoRevFunc) appendCall(r0 StoreQueueRepoRevFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreQueueRepoRevFuncCall objects
// describing the invocations of this function.
func (f *StoreQueueRepoRevFunc) History() []StoreQueueRepoRevFuncCall {
f.mutex.Lock()
history := make([]StoreQueueRepoRevFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreQueueRepoRevFuncCall is an object that describes an invocation of
// method QueueRepoRev on an instance of MockStore.
type StoreQueueRepoRevFuncCall struct {
// Arg0 is the value of the 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 StoreQueueRepoRevFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreQueueRepoRevFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreRepositoryExceptionsFunc describes the behavior when the
// RepositoryExceptions method of the parent MockStore instance is invoked.
type StoreRepositoryExceptionsFunc struct {
defaultHook func(context.Context, int) (bool, bool, error)
hooks []func(context.Context, int) (bool, bool, error)
history []StoreRepositoryExceptionsFuncCall
mutex sync.Mutex
}
// RepositoryExceptions delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) RepositoryExceptions(v0 context.Context, v1 int) (bool, bool, error) {
r0, r1, r2 := m.RepositoryExceptionsFunc.nextHook()(v0, v1)
m.RepositoryExceptionsFunc.appendCall(StoreRepositoryExceptionsFuncCall{v0, v1, r0, r1, r2})
return r0, r1, r2
}
// SetDefaultHook sets function that is called when the RepositoryExceptions
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreRepositoryExceptionsFunc) SetDefaultHook(hook func(context.Context, int) (bool, bool, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// RepositoryExceptions 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 *StoreRepositoryExceptionsFunc) PushHook(hook func(context.Context, int) (bool, 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 *StoreRepositoryExceptionsFunc) SetDefaultReturn(r0 bool, r1 bool, r2 error) {
f.SetDefaultHook(func(context.Context, int) (bool, bool, error) {
return r0, r1, r2
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreRepositoryExceptionsFunc) PushReturn(r0 bool, r1 bool, r2 error) {
f.PushHook(func(context.Context, int) (bool, bool, error) {
return r0, r1, r2
})
}
func (f *StoreRepositoryExceptionsFunc) nextHook() func(context.Context, int) (bool, 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 *StoreRepositoryExceptionsFunc) appendCall(r0 StoreRepositoryExceptionsFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreRepositoryExceptionsFuncCall objects
// describing the invocations of this function.
func (f *StoreRepositoryExceptionsFunc) History() []StoreRepositoryExceptionsFuncCall {
f.mutex.Lock()
history := make([]StoreRepositoryExceptionsFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreRepositoryExceptionsFuncCall is an object that describes an
// invocation of method RepositoryExceptions on an instance of MockStore.
type StoreRepositoryExceptionsFuncCall struct {
// Arg0 is the value of the 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 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 StoreRepositoryExceptionsFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreRepositoryExceptionsFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1, c.Result2}
}
// StoreRepositoryIDsWithConfigurationFunc describes the behavior when the
// RepositoryIDsWithConfiguration method of the parent MockStore instance is
// invoked.
type StoreRepositoryIDsWithConfigurationFunc struct {
defaultHook func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error)
hooks []func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error)
history []StoreRepositoryIDsWithConfigurationFuncCall
mutex sync.Mutex
}
// RepositoryIDsWithConfiguration delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockStore) RepositoryIDsWithConfiguration(v0 context.Context, v1 int, v2 int) ([]shared1.RepositoryWithAvailableIndexers, int, error) {
r0, r1, r2 := m.RepositoryIDsWithConfigurationFunc.nextHook()(v0, v1, v2)
m.RepositoryIDsWithConfigurationFunc.appendCall(StoreRepositoryIDsWithConfigurationFuncCall{v0, v1, v2, r0, r1, r2})
return r0, r1, r2
}
// SetDefaultHook sets function that is called when the
// RepositoryIDsWithConfiguration method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreRepositoryIDsWithConfigurationFunc) SetDefaultHook(hook func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// RepositoryIDsWithConfiguration 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 *StoreRepositoryIDsWithConfigurationFunc) PushHook(hook func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, 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 *StoreRepositoryIDsWithConfigurationFunc) SetDefaultReturn(r0 []shared1.RepositoryWithAvailableIndexers, r1 int, r2 error) {
f.SetDefaultHook(func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error) {
return r0, r1, r2
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreRepositoryIDsWithConfigurationFunc) PushReturn(r0 []shared1.RepositoryWithAvailableIndexers, r1 int, r2 error) {
f.PushHook(func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, int, error) {
return r0, r1, r2
})
}
func (f *StoreRepositoryIDsWithConfigurationFunc) nextHook() func(context.Context, int, int) ([]shared1.RepositoryWithAvailableIndexers, 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 *StoreRepositoryIDsWithConfigurationFunc) appendCall(r0 StoreRepositoryIDsWithConfigurationFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreRepositoryIDsWithConfigurationFuncCall
// objects describing the invocations of this function.
func (f *StoreRepositoryIDsWithConfigurationFunc) History() []StoreRepositoryIDsWithConfigurationFuncCall {
f.mutex.Lock()
history := make([]StoreRepositoryIDsWithConfigurationFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreRepositoryIDsWithConfigurationFuncCall is an object that describes
// an invocation of method RepositoryIDsWithConfiguration on an instance of
// MockStore.
type StoreRepositoryIDsWithConfigurationFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Arg2 is the value of the 3rd argument passed to this method
// invocation.
Arg2 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []shared1.RepositoryWithAvailableIndexers
// 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 StoreRepositoryIDsWithConfigurationFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreRepositoryIDsWithConfigurationFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1, c.Result2}
}
// StoreSetConfigurationSummaryFunc describes the behavior when the
// SetConfigurationSummary method of the parent MockStore instance is
// invoked.
type StoreSetConfigurationSummaryFunc struct {
defaultHook func(context.Context, int, int, map[string]shared1.AvailableIndexer) error
hooks []func(context.Context, int, int, map[string]shared1.AvailableIndexer) error
history []StoreSetConfigurationSummaryFuncCall
mutex sync.Mutex
}
// SetConfigurationSummary delegates to the next hook function in the queue
// and stores the parameter and result values of this invocation.
func (m *MockStore) SetConfigurationSummary(v0 context.Context, v1 int, v2 int, v3 map[string]shared1.AvailableIndexer) error {
r0 := m.SetConfigurationSummaryFunc.nextHook()(v0, v1, v2, v3)
m.SetConfigurationSummaryFunc.appendCall(StoreSetConfigurationSummaryFuncCall{v0, v1, v2, v3, r0})
return r0
}
// SetDefaultHook sets function that is called when the
// SetConfigurationSummary method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreSetConfigurationSummaryFunc) SetDefaultHook(hook func(context.Context, int, int, map[string]shared1.AvailableIndexer) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// SetConfigurationSummary 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 *StoreSetConfigurationSummaryFunc) PushHook(hook func(context.Context, int, int, map[string]shared1.AvailableIndexer) error) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *StoreSetConfigurationSummaryFunc) SetDefaultReturn(r0 error) {
f.SetDefaultHook(func(context.Context, int, int, map[string]shared1.AvailableIndexer) error {
return r0
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreSetConfigurationSummaryFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, int, int, map[string]shared1.AvailableIndexer) error {
return r0
})
}
func (f *StoreSetConfigurationSummaryFunc) nextHook() func(context.Context, int, int, map[string]shared1.AvailableIndexer) error {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *StoreSetConfigurationSummaryFunc) appendCall(r0 StoreSetConfigurationSummaryFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreSetConfigurationSummaryFuncCall
// objects describing the invocations of this function.
func (f *StoreSetConfigurationSummaryFunc) History() []StoreSetConfigurationSummaryFuncCall {
f.mutex.Lock()
history := make([]StoreSetConfigurationSummaryFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreSetConfigurationSummaryFuncCall is an object that describes an
// invocation of method SetConfigurationSummary on an instance of MockStore.
type StoreSetConfigurationSummaryFuncCall struct {
// Arg0 is the value of the 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 map[string]shared1.AvailableIndexer
// 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 StoreSetConfigurationSummaryFuncCall) 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 StoreSetConfigurationSummaryFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreSetInferenceScriptFunc describes the behavior when the
// SetInferenceScript method of the parent MockStore instance is invoked.
type StoreSetInferenceScriptFunc struct {
defaultHook func(context.Context, string) error
hooks []func(context.Context, string) error
history []StoreSetInferenceScriptFuncCall
mutex sync.Mutex
}
// SetInferenceScript delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) SetInferenceScript(v0 context.Context, v1 string) error {
r0 := m.SetInferenceScriptFunc.nextHook()(v0, v1)
m.SetInferenceScriptFunc.appendCall(StoreSetInferenceScriptFuncCall{v0, v1, r0})
return r0
}
// SetDefaultHook sets function that is called when the SetInferenceScript
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreSetInferenceScriptFunc) SetDefaultHook(hook func(context.Context, string) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// SetInferenceScript 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 *StoreSetInferenceScriptFunc) PushHook(hook func(context.Context, 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 *StoreSetInferenceScriptFunc) SetDefaultReturn(r0 error) {
f.SetDefaultHook(func(context.Context, string) error {
return r0
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreSetInferenceScriptFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, string) error {
return r0
})
}
func (f *StoreSetInferenceScriptFunc) nextHook() func(context.Context, 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 *StoreSetInferenceScriptFunc) appendCall(r0 StoreSetInferenceScriptFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreSetInferenceScriptFuncCall objects
// describing the invocations of this function.
func (f *StoreSetInferenceScriptFunc) History() []StoreSetInferenceScriptFuncCall {
f.mutex.Lock()
history := make([]StoreSetInferenceScriptFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreSetInferenceScriptFuncCall is an object that describes an invocation
// of method SetInferenceScript on an instance of MockStore.
type StoreSetInferenceScriptFuncCall struct {
// Arg0 is the value of the 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
// 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 StoreSetInferenceScriptFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreSetInferenceScriptFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreSetRepositoryExceptionsFunc describes the behavior when the
// SetRepositoryExceptions method of the parent MockStore instance is
// invoked.
type StoreSetRepositoryExceptionsFunc struct {
defaultHook func(context.Context, int, bool, bool) error
hooks []func(context.Context, int, bool, bool) error
history []StoreSetRepositoryExceptionsFuncCall
mutex sync.Mutex
}
// SetRepositoryExceptions delegates to the next hook function in the queue
// and stores the parameter and result values of this invocation.
func (m *MockStore) SetRepositoryExceptions(v0 context.Context, v1 int, v2 bool, v3 bool) error {
r0 := m.SetRepositoryExceptionsFunc.nextHook()(v0, v1, v2, v3)
m.SetRepositoryExceptionsFunc.appendCall(StoreSetRepositoryExceptionsFuncCall{v0, v1, v2, v3, r0})
return r0
}
// SetDefaultHook sets function that is called when the
// SetRepositoryExceptions method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreSetRepositoryExceptionsFunc) SetDefaultHook(hook func(context.Context, int, bool, bool) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// SetRepositoryExceptions 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 *StoreSetRepositoryExceptionsFunc) PushHook(hook func(context.Context, int, bool, 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 *StoreSetRepositoryExceptionsFunc) SetDefaultReturn(r0 error) {
f.SetDefaultHook(func(context.Context, int, bool, bool) error {
return r0
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreSetRepositoryExceptionsFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, int, bool, bool) error {
return r0
})
}
func (f *StoreSetRepositoryExceptionsFunc) nextHook() func(context.Context, int, bool, 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 *StoreSetRepositoryExceptionsFunc) appendCall(r0 StoreSetRepositoryExceptionsFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreSetRepositoryExceptionsFuncCall
// objects describing the invocations of this function.
func (f *StoreSetRepositoryExceptionsFunc) History() []StoreSetRepositoryExceptionsFuncCall {
f.mutex.Lock()
history := make([]StoreSetRepositoryExceptionsFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreSetRepositoryExceptionsFuncCall is an object that describes an
// invocation of method SetRepositoryExceptions on an instance of MockStore.
type StoreSetRepositoryExceptionsFuncCall struct {
// Arg0 is the value of the 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 bool
// Arg3 is the value of the 4th argument passed to this method
// invocation.
Arg3 bool
// 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 StoreSetRepositoryExceptionsFuncCall) 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 StoreSetRepositoryExceptionsFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreTopRepositoriesToConfigureFunc describes the behavior when the
// TopRepositoriesToConfigure method of the parent MockStore instance is
// invoked.
type StoreTopRepositoriesToConfigureFunc struct {
defaultHook func(context.Context, int) ([]shared1.RepositoryWithCount, error)
hooks []func(context.Context, int) ([]shared1.RepositoryWithCount, error)
history []StoreTopRepositoriesToConfigureFuncCall
mutex sync.Mutex
}
// TopRepositoriesToConfigure delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockStore) TopRepositoriesToConfigure(v0 context.Context, v1 int) ([]shared1.RepositoryWithCount, error) {
r0, r1 := m.TopRepositoriesToConfigureFunc.nextHook()(v0, v1)
m.TopRepositoriesToConfigureFunc.appendCall(StoreTopRepositoriesToConfigureFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the
// TopRepositoriesToConfigure method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreTopRepositoriesToConfigureFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.RepositoryWithCount, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// TopRepositoriesToConfigure 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 *StoreTopRepositoriesToConfigureFunc) PushHook(hook func(context.Context, int) ([]shared1.RepositoryWithCount, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *StoreTopRepositoriesToConfigureFunc) SetDefaultReturn(r0 []shared1.RepositoryWithCount, r1 error) {
f.SetDefaultHook(func(context.Context, int) ([]shared1.RepositoryWithCount, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreTopRepositoriesToConfigureFunc) PushReturn(r0 []shared1.RepositoryWithCount, r1 error) {
f.PushHook(func(context.Context, int) ([]shared1.RepositoryWithCount, error) {
return r0, r1
})
}
func (f *StoreTopRepositoriesToConfigureFunc) nextHook() func(context.Context, int) ([]shared1.RepositoryWithCount, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *StoreTopRepositoriesToConfigureFunc) appendCall(r0 StoreTopRepositoriesToConfigureFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreTopRepositoriesToConfigureFuncCall
// objects describing the invocations of this function.
func (f *StoreTopRepositoriesToConfigureFunc) History() []StoreTopRepositoriesToConfigureFuncCall {
f.mutex.Lock()
history := make([]StoreTopRepositoriesToConfigureFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreTopRepositoriesToConfigureFuncCall is an object that describes an
// invocation of method TopRepositoriesToConfigure on an instance of
// MockStore.
type StoreTopRepositoriesToConfigureFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []shared1.RepositoryWithCount
// 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 StoreTopRepositoriesToConfigureFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreTopRepositoriesToConfigureFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// StoreTruncateConfigurationSummaryFunc describes the behavior when the
// TruncateConfigurationSummary method of the parent MockStore instance is
// invoked.
type StoreTruncateConfigurationSummaryFunc struct {
defaultHook func(context.Context, int) error
hooks []func(context.Context, int) error
history []StoreTruncateConfigurationSummaryFuncCall
mutex sync.Mutex
}
// TruncateConfigurationSummary delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockStore) TruncateConfigurationSummary(v0 context.Context, v1 int) error {
r0 := m.TruncateConfigurationSummaryFunc.nextHook()(v0, v1)
m.TruncateConfigurationSummaryFunc.appendCall(StoreTruncateConfigurationSummaryFuncCall{v0, v1, r0})
return r0
}
// SetDefaultHook sets function that is called when the
// TruncateConfigurationSummary method of the parent MockStore instance is
// invoked and the hook queue is empty.
func (f *StoreTruncateConfigurationSummaryFunc) SetDefaultHook(hook func(context.Context, int) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// TruncateConfigurationSummary 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 *StoreTruncateConfigurationSummaryFunc) 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 *StoreTruncateConfigurationSummaryFunc) 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 *StoreTruncateConfigurationSummaryFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, int) error {
return r0
})
}
func (f *StoreTruncateConfigurationSummaryFunc) 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 *StoreTruncateConfigurationSummaryFunc) appendCall(r0 StoreTruncateConfigurationSummaryFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreTruncateConfigurationSummaryFuncCall
// objects describing the invocations of this function.
func (f *StoreTruncateConfigurationSummaryFunc) History() []StoreTruncateConfigurationSummaryFuncCall {
f.mutex.Lock()
history := make([]StoreTruncateConfigurationSummaryFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreTruncateConfigurationSummaryFuncCall is an object that describes an
// invocation of method TruncateConfigurationSummary on an instance of
// MockStore.
type StoreTruncateConfigurationSummaryFuncCall struct {
// Arg0 is the value of the 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 StoreTruncateConfigurationSummaryFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreTruncateConfigurationSummaryFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreUpdateIndexConfigurationByRepositoryIDFunc describes the behavior
// when the UpdateIndexConfigurationByRepositoryID method of the parent
// MockStore instance is invoked.
type StoreUpdateIndexConfigurationByRepositoryIDFunc struct {
defaultHook func(context.Context, int, []byte) error
hooks []func(context.Context, int, []byte) error
history []StoreUpdateIndexConfigurationByRepositoryIDFuncCall
mutex sync.Mutex
}
// UpdateIndexConfigurationByRepositoryID delegates to the next hook
// function in the queue and stores the parameter and result values of this
// invocation.
func (m *MockStore) UpdateIndexConfigurationByRepositoryID(v0 context.Context, v1 int, v2 []byte) error {
r0 := m.UpdateIndexConfigurationByRepositoryIDFunc.nextHook()(v0, v1, v2)
m.UpdateIndexConfigurationByRepositoryIDFunc.appendCall(StoreUpdateIndexConfigurationByRepositoryIDFuncCall{v0, v1, v2, r0})
return r0
}
// SetDefaultHook sets function that is called when the
// UpdateIndexConfigurationByRepositoryID method of the parent MockStore
// instance is invoked and the hook queue is empty.
func (f *StoreUpdateIndexConfigurationByRepositoryIDFunc) SetDefaultHook(hook func(context.Context, int, []byte) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// UpdateIndexConfigurationByRepositoryID 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 *StoreUpdateIndexConfigurationByRepositoryIDFunc) PushHook(hook func(context.Context, int, []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 *StoreUpdateIndexConfigurationByRepositoryIDFunc) SetDefaultReturn(r0 error) {
f.SetDefaultHook(func(context.Context, int, []byte) error {
return r0
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreUpdateIndexConfigurationByRepositoryIDFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, int, []byte) error {
return r0
})
}
func (f *StoreUpdateIndexConfigurationByRepositoryIDFunc) nextHook() func(context.Context, int, []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 *StoreUpdateIndexConfigurationByRepositoryIDFunc) appendCall(r0 StoreUpdateIndexConfigurationByRepositoryIDFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of
// StoreUpdateIndexConfigurationByRepositoryIDFuncCall objects describing
// the invocations of this function.
func (f *StoreUpdateIndexConfigurationByRepositoryIDFunc) History() []StoreUpdateIndexConfigurationByRepositoryIDFuncCall {
f.mutex.Lock()
history := make([]StoreUpdateIndexConfigurationByRepositoryIDFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreUpdateIndexConfigurationByRepositoryIDFuncCall is an object that
// describes an invocation of method UpdateIndexConfigurationByRepositoryID
// on an instance of MockStore.
type StoreUpdateIndexConfigurationByRepositoryIDFuncCall struct {
// Arg0 is the value of the 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 []byte
// 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 StoreUpdateIndexConfigurationByRepositoryIDFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1, c.Arg2}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreUpdateIndexConfigurationByRepositoryIDFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// StoreWithTransactionFunc describes the behavior when the WithTransaction
// method of the parent MockStore instance is invoked.
type StoreWithTransactionFunc struct {
defaultHook func(context.Context, func(tx store.Store) error) error
hooks []func(context.Context, func(tx store.Store) error) error
history []StoreWithTransactionFuncCall
mutex sync.Mutex
}
// WithTransaction delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockStore) WithTransaction(v0 context.Context, v1 func(tx store.Store) error) error {
r0 := m.WithTransactionFunc.nextHook()(v0, v1)
m.WithTransactionFunc.appendCall(StoreWithTransactionFuncCall{v0, v1, r0})
return r0
}
// SetDefaultHook sets function that is called when the WithTransaction
// method of the parent MockStore instance is invoked and the hook queue is
// empty.
func (f *StoreWithTransactionFunc) SetDefaultHook(hook func(context.Context, func(tx store.Store) error) error) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// WithTransaction method of the parent MockStore instance invokes the hook
// at the front of the queue and discards it. After the queue is empty, the
// default hook function is invoked for any future action.
func (f *StoreWithTransactionFunc) PushHook(hook func(context.Context, func(tx store.Store) error) error) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *StoreWithTransactionFunc) SetDefaultReturn(r0 error) {
f.SetDefaultHook(func(context.Context, func(tx store.Store) error) error {
return r0
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *StoreWithTransactionFunc) PushReturn(r0 error) {
f.PushHook(func(context.Context, func(tx store.Store) error) error {
return r0
})
}
func (f *StoreWithTransactionFunc) nextHook() func(context.Context, func(tx store.Store) error) error {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *StoreWithTransactionFunc) appendCall(r0 StoreWithTransactionFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of StoreWithTransactionFuncCall objects
// describing the invocations of this function.
func (f *StoreWithTransactionFunc) History() []StoreWithTransactionFuncCall {
f.mutex.Lock()
history := make([]StoreWithTransactionFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// StoreWithTransactionFuncCall is an object that describes an invocation of
// method WithTransaction on an instance of MockStore.
type StoreWithTransactionFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 func(tx store.Store) error
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c StoreWithTransactionFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c StoreWithTransactionFuncCall) Results() []interface{} {
return []interface{}{c.Result0}
}
// MockInferenceService is a mock implementation of the InferenceService
// interface (from the package
// github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing) used
// for unit testing.
type MockInferenceService struct {
// InferIndexJobsFunc is an instance of a mock function object
// controlling the behavior of the method InferIndexJobs.
InferIndexJobsFunc *InferenceServiceInferIndexJobsFunc
}
// NewMockInferenceService creates a new mock of the InferenceService
// interface. All methods return zero values for all results, unless
// overwritten.
func NewMockInferenceService() *MockInferenceService {
return &MockInferenceService{
InferIndexJobsFunc: &InferenceServiceInferIndexJobsFunc{
defaultHook: func(context.Context, api.RepoName, string, string) (r0 *shared.InferenceResult, r1 error) {
return
},
},
}
}
// NewStrictMockInferenceService creates a new mock of the InferenceService
// interface. All methods panic on invocation, unless overwritten.
func NewStrictMockInferenceService() *MockInferenceService {
return &MockInferenceService{
InferIndexJobsFunc: &InferenceServiceInferIndexJobsFunc{
defaultHook: func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error) {
panic("unexpected invocation of MockInferenceService.InferIndexJobs")
},
},
}
}
// NewMockInferenceServiceFrom creates a new mock of the
// MockInferenceService interface. All methods delegate to the given
// implementation, unless overwritten.
func NewMockInferenceServiceFrom(i InferenceService) *MockInferenceService {
return &MockInferenceService{
InferIndexJobsFunc: &InferenceServiceInferIndexJobsFunc{
defaultHook: i.InferIndexJobs,
},
}
}
// InferenceServiceInferIndexJobsFunc describes the behavior when the
// InferIndexJobs method of the parent MockInferenceService instance is
// invoked.
type InferenceServiceInferIndexJobsFunc struct {
defaultHook func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error)
hooks []func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error)
history []InferenceServiceInferIndexJobsFuncCall
mutex sync.Mutex
}
// InferIndexJobs delegates to the next hook function in the queue and
// stores the parameter and result values of this invocation.
func (m *MockInferenceService) InferIndexJobs(v0 context.Context, v1 api.RepoName, v2 string, v3 string) (*shared.InferenceResult, error) {
r0, r1 := m.InferIndexJobsFunc.nextHook()(v0, v1, v2, v3)
m.InferIndexJobsFunc.appendCall(InferenceServiceInferIndexJobsFuncCall{v0, v1, v2, v3, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the InferIndexJobs
// method of the parent MockInferenceService instance is invoked and the
// hook queue is empty.
func (f *InferenceServiceInferIndexJobsFunc) SetDefaultHook(hook func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// InferIndexJobs method of the parent MockInferenceService instance invokes
// the hook at the front of the queue and discards it. After the queue is
// empty, the default hook function is invoked for any future action.
func (f *InferenceServiceInferIndexJobsFunc) PushHook(hook func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *InferenceServiceInferIndexJobsFunc) SetDefaultReturn(r0 *shared.InferenceResult, r1 error) {
f.SetDefaultHook(func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *InferenceServiceInferIndexJobsFunc) PushReturn(r0 *shared.InferenceResult, r1 error) {
f.PushHook(func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error) {
return r0, r1
})
}
func (f *InferenceServiceInferIndexJobsFunc) nextHook() func(context.Context, api.RepoName, string, string) (*shared.InferenceResult, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *InferenceServiceInferIndexJobsFunc) appendCall(r0 InferenceServiceInferIndexJobsFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of InferenceServiceInferIndexJobsFuncCall
// objects describing the invocations of this function.
func (f *InferenceServiceInferIndexJobsFunc) History() []InferenceServiceInferIndexJobsFuncCall {
f.mutex.Lock()
history := make([]InferenceServiceInferIndexJobsFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// InferenceServiceInferIndexJobsFuncCall is an object that describes an
// invocation of method InferIndexJobs on an instance of
// MockInferenceService.
type InferenceServiceInferIndexJobsFuncCall struct {
// Arg0 is the value of the 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 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 *shared.InferenceResult
// 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 InferenceServiceInferIndexJobsFuncCall) 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 InferenceServiceInferIndexJobsFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// MockUploadService is a mock implementation of the UploadService interface
// (from the package
// github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing) used
// for unit testing.
type MockUploadService struct {
// GetRecentAutoIndexJobsSummaryFunc is an instance of a mock function
// object controlling the behavior of the method
// GetRecentAutoIndexJobsSummary.
GetRecentAutoIndexJobsSummaryFunc *UploadServiceGetRecentAutoIndexJobsSummaryFunc
// GetRecentUploadsSummaryFunc is an instance of a mock function object
// controlling the behavior of the method GetRecentUploadsSummary.
GetRecentUploadsSummaryFunc *UploadServiceGetRecentUploadsSummaryFunc
// GetUploadByIDFunc is an instance of a mock function object
// controlling the behavior of the method GetUploadByID.
GetUploadByIDFunc *UploadServiceGetUploadByIDFunc
// ReferencesForUploadFunc is an instance of a mock function object
// controlling the behavior of the method ReferencesForUpload.
ReferencesForUploadFunc *UploadServiceReferencesForUploadFunc
}
// NewMockUploadService creates a new mock of the UploadService interface.
// All methods return zero values for all results, unless overwritten.
func NewMockUploadService() *MockUploadService {
return &MockUploadService{
GetRecentAutoIndexJobsSummaryFunc: &UploadServiceGetRecentAutoIndexJobsSummaryFunc{
defaultHook: func(context.Context, int) (r0 []shared1.GroupedAutoIndexJobs, r1 error) {
return
},
},
GetRecentUploadsSummaryFunc: &UploadServiceGetRecentUploadsSummaryFunc{
defaultHook: func(context.Context, int) (r0 []shared1.UploadsWithRepositoryNamespace, r1 error) {
return
},
},
GetUploadByIDFunc: &UploadServiceGetUploadByIDFunc{
defaultHook: func(context.Context, int) (r0 shared1.Upload, r1 bool, r2 error) {
return
},
},
ReferencesForUploadFunc: &UploadServiceReferencesForUploadFunc{
defaultHook: func(context.Context, int) (r0 shared1.PackageReferenceScanner, r1 error) {
return
},
},
}
}
// NewStrictMockUploadService creates a new mock of the UploadService
// interface. All methods panic on invocation, unless overwritten.
func NewStrictMockUploadService() *MockUploadService {
return &MockUploadService{
GetRecentAutoIndexJobsSummaryFunc: &UploadServiceGetRecentAutoIndexJobsSummaryFunc{
defaultHook: func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) {
panic("unexpected invocation of MockUploadService.GetRecentAutoIndexJobsSummary")
},
},
GetRecentUploadsSummaryFunc: &UploadServiceGetRecentUploadsSummaryFunc{
defaultHook: func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) {
panic("unexpected invocation of MockUploadService.GetRecentUploadsSummary")
},
},
GetUploadByIDFunc: &UploadServiceGetUploadByIDFunc{
defaultHook: func(context.Context, int) (shared1.Upload, bool, error) {
panic("unexpected invocation of MockUploadService.GetUploadByID")
},
},
ReferencesForUploadFunc: &UploadServiceReferencesForUploadFunc{
defaultHook: func(context.Context, int) (shared1.PackageReferenceScanner, error) {
panic("unexpected invocation of MockUploadService.ReferencesForUpload")
},
},
}
}
// NewMockUploadServiceFrom creates a new mock of the MockUploadService
// interface. All methods delegate to the given implementation, unless
// overwritten.
func NewMockUploadServiceFrom(i UploadService) *MockUploadService {
return &MockUploadService{
GetRecentAutoIndexJobsSummaryFunc: &UploadServiceGetRecentAutoIndexJobsSummaryFunc{
defaultHook: i.GetRecentAutoIndexJobsSummary,
},
GetRecentUploadsSummaryFunc: &UploadServiceGetRecentUploadsSummaryFunc{
defaultHook: i.GetRecentUploadsSummary,
},
GetUploadByIDFunc: &UploadServiceGetUploadByIDFunc{
defaultHook: i.GetUploadByID,
},
ReferencesForUploadFunc: &UploadServiceReferencesForUploadFunc{
defaultHook: i.ReferencesForUpload,
},
}
}
// UploadServiceGetRecentAutoIndexJobsSummaryFunc describes the behavior
// when the GetRecentAutoIndexJobsSummary method of the parent
// MockUploadService instance is invoked.
type UploadServiceGetRecentAutoIndexJobsSummaryFunc struct {
defaultHook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)
hooks []func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)
history []UploadServiceGetRecentAutoIndexJobsSummaryFuncCall
mutex sync.Mutex
}
// GetRecentAutoIndexJobsSummary delegates to the next hook function in the
// queue and stores the parameter and result values of this invocation.
func (m *MockUploadService) GetRecentAutoIndexJobsSummary(v0 context.Context, v1 int) ([]shared1.GroupedAutoIndexJobs, error) {
r0, r1 := m.GetRecentAutoIndexJobsSummaryFunc.nextHook()(v0, v1)
m.GetRecentAutoIndexJobsSummaryFunc.appendCall(UploadServiceGetRecentAutoIndexJobsSummaryFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the
// GetRecentAutoIndexJobsSummary method of the parent MockUploadService
// instance is invoked and the hook queue is empty.
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetRecentAutoIndexJobsSummary method of the parent MockUploadService
// instance invokes the hook at the front of the queue and discards it.
// After the queue is empty, the default hook function is invoked for any
// future action.
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) SetDefaultReturn(r0 []shared1.GroupedAutoIndexJobs, r1 error) {
f.SetDefaultHook(func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) PushReturn(r0 []shared1.GroupedAutoIndexJobs, r1 error) {
f.PushHook(func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) {
return r0, r1
})
}
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) nextHook() func(context.Context, int) ([]shared1.GroupedAutoIndexJobs, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) appendCall(r0 UploadServiceGetRecentAutoIndexJobsSummaryFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of
// UploadServiceGetRecentAutoIndexJobsSummaryFuncCall objects describing the
// invocations of this function.
func (f *UploadServiceGetRecentAutoIndexJobsSummaryFunc) History() []UploadServiceGetRecentAutoIndexJobsSummaryFuncCall {
f.mutex.Lock()
history := make([]UploadServiceGetRecentAutoIndexJobsSummaryFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// UploadServiceGetRecentAutoIndexJobsSummaryFuncCall is an object that
// describes an invocation of method GetRecentAutoIndexJobsSummary on an
// instance of MockUploadService.
type UploadServiceGetRecentAutoIndexJobsSummaryFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []shared1.GroupedAutoIndexJobs
// Result1 is the value of the 2nd result returned from this method
// invocation.
Result1 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c UploadServiceGetRecentAutoIndexJobsSummaryFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c UploadServiceGetRecentAutoIndexJobsSummaryFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// UploadServiceGetRecentUploadsSummaryFunc describes the behavior when the
// GetRecentUploadsSummary method of the parent MockUploadService instance
// is invoked.
type UploadServiceGetRecentUploadsSummaryFunc struct {
defaultHook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)
hooks []func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)
history []UploadServiceGetRecentUploadsSummaryFuncCall
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 *MockUploadService) GetRecentUploadsSummary(v0 context.Context, v1 int) ([]shared1.UploadsWithRepositoryNamespace, error) {
r0, r1 := m.GetRecentUploadsSummaryFunc.nextHook()(v0, v1)
m.GetRecentUploadsSummaryFunc.appendCall(UploadServiceGetRecentUploadsSummaryFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the
// GetRecentUploadsSummary method of the parent MockUploadService instance
// is invoked and the hook queue is empty.
func (f *UploadServiceGetRecentUploadsSummaryFunc) SetDefaultHook(hook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetRecentUploadsSummary method of the parent MockUploadService instance
// invokes the hook at the front of the queue and discards it. After the
// queue is empty, the default hook function is invoked for any future
// action.
func (f *UploadServiceGetRecentUploadsSummaryFunc) PushHook(hook func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *UploadServiceGetRecentUploadsSummaryFunc) SetDefaultReturn(r0 []shared1.UploadsWithRepositoryNamespace, r1 error) {
f.SetDefaultHook(func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *UploadServiceGetRecentUploadsSummaryFunc) PushReturn(r0 []shared1.UploadsWithRepositoryNamespace, r1 error) {
f.PushHook(func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) {
return r0, r1
})
}
func (f *UploadServiceGetRecentUploadsSummaryFunc) nextHook() func(context.Context, int) ([]shared1.UploadsWithRepositoryNamespace, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *UploadServiceGetRecentUploadsSummaryFunc) appendCall(r0 UploadServiceGetRecentUploadsSummaryFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of
// UploadServiceGetRecentUploadsSummaryFuncCall objects describing the
// invocations of this function.
func (f *UploadServiceGetRecentUploadsSummaryFunc) History() []UploadServiceGetRecentUploadsSummaryFuncCall {
f.mutex.Lock()
history := make([]UploadServiceGetRecentUploadsSummaryFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// UploadServiceGetRecentUploadsSummaryFuncCall is an object that describes
// an invocation of method GetRecentUploadsSummary on an instance of
// MockUploadService.
type UploadServiceGetRecentUploadsSummaryFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 []shared1.UploadsWithRepositoryNamespace
// Result1 is the value of the 2nd result returned from this method
// invocation.
Result1 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c UploadServiceGetRecentUploadsSummaryFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c UploadServiceGetRecentUploadsSummaryFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}
// UploadServiceGetUploadByIDFunc describes the behavior when the
// GetUploadByID method of the parent MockUploadService instance is invoked.
type UploadServiceGetUploadByIDFunc struct {
defaultHook func(context.Context, int) (shared1.Upload, bool, error)
hooks []func(context.Context, int) (shared1.Upload, bool, error)
history []UploadServiceGetUploadByIDFuncCall
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 *MockUploadService) GetUploadByID(v0 context.Context, v1 int) (shared1.Upload, bool, error) {
r0, r1, r2 := m.GetUploadByIDFunc.nextHook()(v0, v1)
m.GetUploadByIDFunc.appendCall(UploadServiceGetUploadByIDFuncCall{v0, v1, r0, r1, r2})
return r0, r1, r2
}
// SetDefaultHook sets function that is called when the GetUploadByID method
// of the parent MockUploadService instance is invoked and the hook queue is
// empty.
func (f *UploadServiceGetUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (shared1.Upload, bool, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// GetUploadByID method of the parent MockUploadService instance invokes the
// hook at the front of the queue and discards it. After the queue is empty,
// the default hook function is invoked for any future action.
func (f *UploadServiceGetUploadByIDFunc) PushHook(hook func(context.Context, int) (shared1.Upload, bool, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *UploadServiceGetUploadByIDFunc) SetDefaultReturn(r0 shared1.Upload, r1 bool, r2 error) {
f.SetDefaultHook(func(context.Context, int) (shared1.Upload, bool, error) {
return r0, r1, r2
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *UploadServiceGetUploadByIDFunc) PushReturn(r0 shared1.Upload, r1 bool, r2 error) {
f.PushHook(func(context.Context, int) (shared1.Upload, bool, error) {
return r0, r1, r2
})
}
func (f *UploadServiceGetUploadByIDFunc) nextHook() func(context.Context, int) (shared1.Upload, bool, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *UploadServiceGetUploadByIDFunc) appendCall(r0 UploadServiceGetUploadByIDFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of UploadServiceGetUploadByIDFuncCall objects
// describing the invocations of this function.
func (f *UploadServiceGetUploadByIDFunc) History() []UploadServiceGetUploadByIDFuncCall {
f.mutex.Lock()
history := make([]UploadServiceGetUploadByIDFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// UploadServiceGetUploadByIDFuncCall is an object that describes an
// invocation of method GetUploadByID on an instance of MockUploadService.
type UploadServiceGetUploadByIDFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 shared1.Upload
// Result1 is the value of the 2nd result returned from this method
// invocation.
Result1 bool
// Result2 is the value of the 3rd result returned from this method
// invocation.
Result2 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c UploadServiceGetUploadByIDFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c UploadServiceGetUploadByIDFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1, c.Result2}
}
// UploadServiceReferencesForUploadFunc describes the behavior when the
// ReferencesForUpload method of the parent MockUploadService instance is
// invoked.
type UploadServiceReferencesForUploadFunc struct {
defaultHook func(context.Context, int) (shared1.PackageReferenceScanner, error)
hooks []func(context.Context, int) (shared1.PackageReferenceScanner, error)
history []UploadServiceReferencesForUploadFuncCall
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 *MockUploadService) ReferencesForUpload(v0 context.Context, v1 int) (shared1.PackageReferenceScanner, error) {
r0, r1 := m.ReferencesForUploadFunc.nextHook()(v0, v1)
m.ReferencesForUploadFunc.appendCall(UploadServiceReferencesForUploadFuncCall{v0, v1, r0, r1})
return r0, r1
}
// SetDefaultHook sets function that is called when the ReferencesForUpload
// method of the parent MockUploadService instance is invoked and the hook
// queue is empty.
func (f *UploadServiceReferencesForUploadFunc) SetDefaultHook(hook func(context.Context, int) (shared1.PackageReferenceScanner, error)) {
f.defaultHook = hook
}
// PushHook adds a function to the end of hook queue. Each invocation of the
// ReferencesForUpload method of the parent MockUploadService instance
// invokes the hook at the front of the queue and discards it. After the
// queue is empty, the default hook function is invoked for any future
// action.
func (f *UploadServiceReferencesForUploadFunc) PushHook(hook func(context.Context, int) (shared1.PackageReferenceScanner, error)) {
f.mutex.Lock()
f.hooks = append(f.hooks, hook)
f.mutex.Unlock()
}
// SetDefaultReturn calls SetDefaultHook with a function that returns the
// given values.
func (f *UploadServiceReferencesForUploadFunc) SetDefaultReturn(r0 shared1.PackageReferenceScanner, r1 error) {
f.SetDefaultHook(func(context.Context, int) (shared1.PackageReferenceScanner, error) {
return r0, r1
})
}
// PushReturn calls PushHook with a function that returns the given values.
func (f *UploadServiceReferencesForUploadFunc) PushReturn(r0 shared1.PackageReferenceScanner, r1 error) {
f.PushHook(func(context.Context, int) (shared1.PackageReferenceScanner, error) {
return r0, r1
})
}
func (f *UploadServiceReferencesForUploadFunc) nextHook() func(context.Context, int) (shared1.PackageReferenceScanner, error) {
f.mutex.Lock()
defer f.mutex.Unlock()
if len(f.hooks) == 0 {
return f.defaultHook
}
hook := f.hooks[0]
f.hooks = f.hooks[1:]
return hook
}
func (f *UploadServiceReferencesForUploadFunc) appendCall(r0 UploadServiceReferencesForUploadFuncCall) {
f.mutex.Lock()
f.history = append(f.history, r0)
f.mutex.Unlock()
}
// History returns a sequence of UploadServiceReferencesForUploadFuncCall
// objects describing the invocations of this function.
func (f *UploadServiceReferencesForUploadFunc) History() []UploadServiceReferencesForUploadFuncCall {
f.mutex.Lock()
history := make([]UploadServiceReferencesForUploadFuncCall, len(f.history))
copy(history, f.history)
f.mutex.Unlock()
return history
}
// UploadServiceReferencesForUploadFuncCall is an object that describes an
// invocation of method ReferencesForUpload on an instance of
// MockUploadService.
type UploadServiceReferencesForUploadFuncCall struct {
// Arg0 is the value of the 1st argument passed to this method
// invocation.
Arg0 context.Context
// Arg1 is the value of the 2nd argument passed to this method
// invocation.
Arg1 int
// Result0 is the value of the 1st result returned from this method
// invocation.
Result0 shared1.PackageReferenceScanner
// Result1 is the value of the 2nd result returned from this method
// invocation.
Result1 error
}
// Args returns an interface slice containing the arguments of this
// invocation.
func (c UploadServiceReferencesForUploadFuncCall) Args() []interface{} {
return []interface{}{c.Arg0, c.Arg1}
}
// Results returns an interface slice containing the results of this
// invocation.
func (c UploadServiceReferencesForUploadFuncCall) Results() []interface{} {
return []interface{}{c.Result0, c.Result1}
}