forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_loggregator_consumer.go
189 lines (168 loc) · 5.52 KB
/
fake_loggregator_consumer.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// This file was generated by counterfeiter
package logsfakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api/logs"
"github.com/cloudfoundry/loggregator_consumer"
"github.com/cloudfoundry/loggregatorlib/logmessage"
)
type FakeLoggregatorConsumer struct {
TailStub func(appGuid string, authToken string) (<-chan *logmessage.LogMessage, error)
tailMutex sync.RWMutex
tailArgsForCall []struct {
appGuid string
authToken string
}
tailReturns struct {
result1 <-chan *logmessage.LogMessage
result2 error
}
RecentStub func(appGuid string, authToken string) ([]*logmessage.LogMessage, error)
recentMutex sync.RWMutex
recentArgsForCall []struct {
appGuid string
authToken string
}
recentReturns struct {
result1 []*logmessage.LogMessage
result2 error
}
CloseStub func() error
closeMutex sync.RWMutex
closeArgsForCall []struct{}
closeReturns struct {
result1 error
}
SetOnConnectCallbackStub func(func())
setOnConnectCallbackMutex sync.RWMutex
setOnConnectCallbackArgsForCall []struct {
arg1 func()
}
SetDebugPrinterStub func(loggregator_consumer.DebugPrinter)
setDebugPrinterMutex sync.RWMutex
setDebugPrinterArgsForCall []struct {
arg1 loggregator_consumer.DebugPrinter
}
}
func (fake *FakeLoggregatorConsumer) Tail(appGuid string, authToken string) (<-chan *logmessage.LogMessage, error) {
fake.tailMutex.Lock()
fake.tailArgsForCall = append(fake.tailArgsForCall, struct {
appGuid string
authToken string
}{appGuid, authToken})
fake.tailMutex.Unlock()
if fake.TailStub != nil {
return fake.TailStub(appGuid, authToken)
} else {
return fake.tailReturns.result1, fake.tailReturns.result2
}
}
func (fake *FakeLoggregatorConsumer) TailCallCount() int {
fake.tailMutex.RLock()
defer fake.tailMutex.RUnlock()
return len(fake.tailArgsForCall)
}
func (fake *FakeLoggregatorConsumer) TailArgsForCall(i int) (string, string) {
fake.tailMutex.RLock()
defer fake.tailMutex.RUnlock()
return fake.tailArgsForCall[i].appGuid, fake.tailArgsForCall[i].authToken
}
func (fake *FakeLoggregatorConsumer) TailReturns(result1 <-chan *logmessage.LogMessage, result2 error) {
fake.TailStub = nil
fake.tailReturns = struct {
result1 <-chan *logmessage.LogMessage
result2 error
}{result1, result2}
}
func (fake *FakeLoggregatorConsumer) Recent(appGuid string, authToken string) ([]*logmessage.LogMessage, error) {
fake.recentMutex.Lock()
fake.recentArgsForCall = append(fake.recentArgsForCall, struct {
appGuid string
authToken string
}{appGuid, authToken})
fake.recentMutex.Unlock()
if fake.RecentStub != nil {
return fake.RecentStub(appGuid, authToken)
} else {
return fake.recentReturns.result1, fake.recentReturns.result2
}
}
func (fake *FakeLoggregatorConsumer) RecentCallCount() int {
fake.recentMutex.RLock()
defer fake.recentMutex.RUnlock()
return len(fake.recentArgsForCall)
}
func (fake *FakeLoggregatorConsumer) RecentArgsForCall(i int) (string, string) {
fake.recentMutex.RLock()
defer fake.recentMutex.RUnlock()
return fake.recentArgsForCall[i].appGuid, fake.recentArgsForCall[i].authToken
}
func (fake *FakeLoggregatorConsumer) RecentReturns(result1 []*logmessage.LogMessage, result2 error) {
fake.RecentStub = nil
fake.recentReturns = struct {
result1 []*logmessage.LogMessage
result2 error
}{result1, result2}
}
func (fake *FakeLoggregatorConsumer) Close() error {
fake.closeMutex.Lock()
fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{})
fake.closeMutex.Unlock()
if fake.CloseStub != nil {
return fake.CloseStub()
} else {
return fake.closeReturns.result1
}
}
func (fake *FakeLoggregatorConsumer) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
func (fake *FakeLoggregatorConsumer) CloseReturns(result1 error) {
fake.CloseStub = nil
fake.closeReturns = struct {
result1 error
}{result1}
}
func (fake *FakeLoggregatorConsumer) SetOnConnectCallback(arg1 func()) {
fake.setOnConnectCallbackMutex.Lock()
fake.setOnConnectCallbackArgsForCall = append(fake.setOnConnectCallbackArgsForCall, struct {
arg1 func()
}{arg1})
fake.setOnConnectCallbackMutex.Unlock()
if fake.SetOnConnectCallbackStub != nil {
fake.SetOnConnectCallbackStub(arg1)
}
}
func (fake *FakeLoggregatorConsumer) SetOnConnectCallbackCallCount() int {
fake.setOnConnectCallbackMutex.RLock()
defer fake.setOnConnectCallbackMutex.RUnlock()
return len(fake.setOnConnectCallbackArgsForCall)
}
func (fake *FakeLoggregatorConsumer) SetOnConnectCallbackArgsForCall(i int) func() {
fake.setOnConnectCallbackMutex.RLock()
defer fake.setOnConnectCallbackMutex.RUnlock()
return fake.setOnConnectCallbackArgsForCall[i].arg1
}
func (fake *FakeLoggregatorConsumer) SetDebugPrinter(arg1 loggregator_consumer.DebugPrinter) {
fake.setDebugPrinterMutex.Lock()
fake.setDebugPrinterArgsForCall = append(fake.setDebugPrinterArgsForCall, struct {
arg1 loggregator_consumer.DebugPrinter
}{arg1})
fake.setDebugPrinterMutex.Unlock()
if fake.SetDebugPrinterStub != nil {
fake.SetDebugPrinterStub(arg1)
}
}
func (fake *FakeLoggregatorConsumer) SetDebugPrinterCallCount() int {
fake.setDebugPrinterMutex.RLock()
defer fake.setDebugPrinterMutex.RUnlock()
return len(fake.setDebugPrinterArgsForCall)
}
func (fake *FakeLoggregatorConsumer) SetDebugPrinterArgsForCall(i int) loggregator_consumer.DebugPrinter {
fake.setDebugPrinterMutex.RLock()
defer fake.setDebugPrinterMutex.RUnlock()
return fake.setDebugPrinterArgsForCall[i].arg1
}
var _ logs.LoggregatorConsumer = new(FakeLoggregatorConsumer)