syncthing/lib/logger/mocks/logger.go

143 lines
3.4 KiB
Go

// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"time"
"github.com/syncthing/syncthing/lib/logger"
)
type Recorder struct {
ClearStub func()
clearMutex sync.RWMutex
clearArgsForCall []struct {
}
SinceStub func(time.Time) []logger.Line
sinceMutex sync.RWMutex
sinceArgsForCall []struct {
arg1 time.Time
}
sinceReturns struct {
result1 []logger.Line
}
sinceReturnsOnCall map[int]struct {
result1 []logger.Line
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Recorder) Clear() {
fake.clearMutex.Lock()
fake.clearArgsForCall = append(fake.clearArgsForCall, struct {
}{})
stub := fake.ClearStub
fake.recordInvocation("Clear", []interface{}{})
fake.clearMutex.Unlock()
if stub != nil {
fake.ClearStub()
}
}
func (fake *Recorder) ClearCallCount() int {
fake.clearMutex.RLock()
defer fake.clearMutex.RUnlock()
return len(fake.clearArgsForCall)
}
func (fake *Recorder) ClearCalls(stub func()) {
fake.clearMutex.Lock()
defer fake.clearMutex.Unlock()
fake.ClearStub = stub
}
func (fake *Recorder) Since(arg1 time.Time) []logger.Line {
fake.sinceMutex.Lock()
ret, specificReturn := fake.sinceReturnsOnCall[len(fake.sinceArgsForCall)]
fake.sinceArgsForCall = append(fake.sinceArgsForCall, struct {
arg1 time.Time
}{arg1})
stub := fake.SinceStub
fakeReturns := fake.sinceReturns
fake.recordInvocation("Since", []interface{}{arg1})
fake.sinceMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *Recorder) SinceCallCount() int {
fake.sinceMutex.RLock()
defer fake.sinceMutex.RUnlock()
return len(fake.sinceArgsForCall)
}
func (fake *Recorder) SinceCalls(stub func(time.Time) []logger.Line) {
fake.sinceMutex.Lock()
defer fake.sinceMutex.Unlock()
fake.SinceStub = stub
}
func (fake *Recorder) SinceArgsForCall(i int) time.Time {
fake.sinceMutex.RLock()
defer fake.sinceMutex.RUnlock()
argsForCall := fake.sinceArgsForCall[i]
return argsForCall.arg1
}
func (fake *Recorder) SinceReturns(result1 []logger.Line) {
fake.sinceMutex.Lock()
defer fake.sinceMutex.Unlock()
fake.SinceStub = nil
fake.sinceReturns = struct {
result1 []logger.Line
}{result1}
}
func (fake *Recorder) SinceReturnsOnCall(i int, result1 []logger.Line) {
fake.sinceMutex.Lock()
defer fake.sinceMutex.Unlock()
fake.SinceStub = nil
if fake.sinceReturnsOnCall == nil {
fake.sinceReturnsOnCall = make(map[int]struct {
result1 []logger.Line
})
}
fake.sinceReturnsOnCall[i] = struct {
result1 []logger.Line
}{result1}
}
func (fake *Recorder) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.clearMutex.RLock()
defer fake.clearMutex.RUnlock()
fake.sinceMutex.RLock()
defer fake.sinceMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Recorder) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ logger.Recorder = new(Recorder)