/
global_forwarding_rules_client.go
50 lines (46 loc) · 1.41 KB
/
global_forwarding_rules_client.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
package fakes
import (
"sync"
gcpcompute "google.golang.org/api/compute/v1"
)
type GlobalForwardingRulesClient struct {
DeleteGlobalForwardingRuleCall struct {
sync.Mutex
CallCount int
Receives struct {
Rule string
}
Returns struct {
Error error
}
Stub func(string) error
}
ListGlobalForwardingRulesCall struct {
sync.Mutex
CallCount int
Returns struct {
ForwardingRuleSlice []*gcpcompute.ForwardingRule
Error error
}
Stub func() ([]*gcpcompute.ForwardingRule, error)
}
}
func (f *GlobalForwardingRulesClient) DeleteGlobalForwardingRule(param1 string) error {
f.DeleteGlobalForwardingRuleCall.Lock()
defer f.DeleteGlobalForwardingRuleCall.Unlock()
f.DeleteGlobalForwardingRuleCall.CallCount++
f.DeleteGlobalForwardingRuleCall.Receives.Rule = param1
if f.DeleteGlobalForwardingRuleCall.Stub != nil {
return f.DeleteGlobalForwardingRuleCall.Stub(param1)
}
return f.DeleteGlobalForwardingRuleCall.Returns.Error
}
func (f *GlobalForwardingRulesClient) ListGlobalForwardingRules() ([]*gcpcompute.ForwardingRule, error) {
f.ListGlobalForwardingRulesCall.Lock()
defer f.ListGlobalForwardingRulesCall.Unlock()
f.ListGlobalForwardingRulesCall.CallCount++
if f.ListGlobalForwardingRulesCall.Stub != nil {
return f.ListGlobalForwardingRulesCall.Stub()
}
return f.ListGlobalForwardingRulesCall.Returns.ForwardingRuleSlice, f.ListGlobalForwardingRulesCall.Returns.Error
}