forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_old_logs_repository.go
118 lines (104 loc) · 3.49 KB
/
fake_old_logs_repository.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/loggregatorlib/logmessage"
)
type FakeOldLogsRepository struct {
RecentLogsForStub func(appGuid string) ([]*logmessage.LogMessage, error)
recentLogsForMutex sync.RWMutex
recentLogsForArgsForCall []struct {
appGuid string
}
recentLogsForReturns struct {
result1 []*logmessage.LogMessage
result2 error
}
TailLogsForStub func(appGuid string, onConnect func(), onMessage func(*logmessage.LogMessage)) error
tailLogsForMutex sync.RWMutex
tailLogsForArgsForCall []struct {
appGuid string
onConnect func()
onMessage func(*logmessage.LogMessage)
}
tailLogsForReturns struct {
result1 error
}
CloseStub func()
closeMutex sync.RWMutex
closeArgsForCall []struct{}
}
func (fake *FakeOldLogsRepository) RecentLogsFor(appGuid string) ([]*logmessage.LogMessage, error) {
fake.recentLogsForMutex.Lock()
fake.recentLogsForArgsForCall = append(fake.recentLogsForArgsForCall, struct {
appGuid string
}{appGuid})
fake.recentLogsForMutex.Unlock()
if fake.RecentLogsForStub != nil {
return fake.RecentLogsForStub(appGuid)
} else {
return fake.recentLogsForReturns.result1, fake.recentLogsForReturns.result2
}
}
func (fake *FakeOldLogsRepository) RecentLogsForCallCount() int {
fake.recentLogsForMutex.RLock()
defer fake.recentLogsForMutex.RUnlock()
return len(fake.recentLogsForArgsForCall)
}
func (fake *FakeOldLogsRepository) RecentLogsForArgsForCall(i int) string {
fake.recentLogsForMutex.RLock()
defer fake.recentLogsForMutex.RUnlock()
return fake.recentLogsForArgsForCall[i].appGuid
}
func (fake *FakeOldLogsRepository) RecentLogsForReturns(result1 []*logmessage.LogMessage, result2 error) {
fake.RecentLogsForStub = nil
fake.recentLogsForReturns = struct {
result1 []*logmessage.LogMessage
result2 error
}{result1, result2}
}
func (fake *FakeOldLogsRepository) TailLogsFor(appGuid string, onConnect func(), onMessage func(*logmessage.LogMessage)) error {
fake.tailLogsForMutex.Lock()
fake.tailLogsForArgsForCall = append(fake.tailLogsForArgsForCall, struct {
appGuid string
onConnect func()
onMessage func(*logmessage.LogMessage)
}{appGuid, onConnect, onMessage})
fake.tailLogsForMutex.Unlock()
if fake.TailLogsForStub != nil {
return fake.TailLogsForStub(appGuid, onConnect, onMessage)
} else {
return fake.tailLogsForReturns.result1
}
}
func (fake *FakeOldLogsRepository) TailLogsForCallCount() int {
fake.tailLogsForMutex.RLock()
defer fake.tailLogsForMutex.RUnlock()
return len(fake.tailLogsForArgsForCall)
}
func (fake *FakeOldLogsRepository) TailLogsForArgsForCall(i int) (string, func(), func(*logmessage.LogMessage)) {
fake.tailLogsForMutex.RLock()
defer fake.tailLogsForMutex.RUnlock()
return fake.tailLogsForArgsForCall[i].appGuid, fake.tailLogsForArgsForCall[i].onConnect, fake.tailLogsForArgsForCall[i].onMessage
}
func (fake *FakeOldLogsRepository) TailLogsForReturns(result1 error) {
fake.TailLogsForStub = nil
fake.tailLogsForReturns = struct {
result1 error
}{result1}
}
func (fake *FakeOldLogsRepository) Close() {
fake.closeMutex.Lock()
fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{})
fake.closeMutex.Unlock()
if fake.CloseStub != nil {
fake.CloseStub()
}
}
func (fake *FakeOldLogsRepository) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
var _ api.OldLogsRepository = new(FakeOldLogsRepository)