forked from cloudfoundry/bosh-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bosh_manager.go
68 lines (62 loc) · 1.46 KB
/
bosh_manager.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
package fakes
import "github.com/cloudfoundry/bosh-bootloader/storage"
type BOSHManager struct {
CreateCall struct {
CallCount int
Receives struct {
State storage.State
OpsFile []byte
}
Returns struct {
State storage.State
Error error
}
}
VersionCall struct {
CallCount int
Returns struct {
Version string
Error error
}
}
DeleteCall struct {
CallCount int
Receives struct {
State storage.State
}
Returns struct {
Error error
}
}
GetDeploymentVarsCall struct {
CallCount int
Receives struct {
State storage.State
}
Returns struct {
Vars string
Error error
}
}
}
func (b *BOSHManager) Create(state storage.State, opsFile []byte) (storage.State, error) {
b.CreateCall.CallCount++
b.CreateCall.Receives.State = state
b.CreateCall.Receives.OpsFile = opsFile
state.BOSH = b.CreateCall.Returns.State.BOSH
return state, b.CreateCall.Returns.Error
}
func (b *BOSHManager) Delete(state storage.State) error {
b.DeleteCall.CallCount++
b.DeleteCall.Receives.State = state
return b.DeleteCall.Returns.Error
}
func (b *BOSHManager) GetDeploymentVars(state storage.State) (string, error) {
b.GetDeploymentVarsCall.CallCount++
b.GetDeploymentVarsCall.Receives.State = state
return b.GetDeploymentVarsCall.Returns.Vars, b.GetDeploymentVarsCall.Returns.Error
}
func (b *BOSHManager) Version() (string, error) {
b.VersionCall.CallCount++
return b.VersionCall.Returns.Version, b.VersionCall.Returns.Error
}