forked from cloudfoundry/bosh-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bosh_client.go
49 lines (42 loc) · 965 Bytes
/
bosh_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
package fakes
import (
"github.com/cloudfoundry/bosh-bootloader/bosh"
"golang.org/x/net/proxy"
)
type BOSHClient struct {
UpdateCloudConfigCall struct {
CallCount int
Receives struct {
Yaml []byte
}
Returns struct {
Error error
}
}
ConfigureHTTPClientCall struct {
CallCount int
Receives struct {
Socks5Client proxy.Dialer
}
}
InfoCall struct {
CallCount int
Returns struct {
Info bosh.Info
Error error
}
}
}
func (c *BOSHClient) UpdateCloudConfig(yaml []byte) error {
c.UpdateCloudConfigCall.CallCount++
c.UpdateCloudConfigCall.Receives.Yaml = yaml
return c.UpdateCloudConfigCall.Returns.Error
}
func (c *BOSHClient) ConfigureHTTPClient(socks5Client proxy.Dialer) {
c.ConfigureHTTPClientCall.CallCount++
c.ConfigureHTTPClientCall.Receives.Socks5Client = socks5Client
}
func (c *BOSHClient) Info() (bosh.Info, error) {
c.InfoCall.CallCount++
return c.InfoCall.Returns.Info, c.InfoCall.Returns.Error
}