-
Notifications
You must be signed in to change notification settings - Fork 180
/
interfaces.go
113 lines (95 loc) · 3.2 KB
/
interfaces.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
package commands
import (
"github.com/cloudfoundry/bosh-bootloader/certs"
"github.com/cloudfoundry/bosh-bootloader/storage"
"github.com/cloudfoundry/bosh-bootloader/terraform"
)
type plan interface {
CheckFastFails([]string, storage.State) error
ParseArgs([]string, storage.State) (PlanConfig, error)
Execute([]string, storage.State) error
InitializePlan(PlanConfig, storage.State) (storage.State, error)
IsInitialized(storage.State) bool
}
type up interface {
CheckFastFails([]string, storage.State) error
ParseArgs([]string, storage.State) (PlanConfig, error)
Execute([]string, storage.State) error
}
type terraformManager interface {
ValidateVersion() error
GetOutputs() (terraform.Outputs, error)
Setup(storage.State) error
Init(storage.State) error
Apply(storage.State) (storage.State, error)
Validate(storage.State) (storage.State, error)
Destroy(storage.State) (storage.State, error)
IsPaved() (bool, error)
}
type boshManager interface {
InitializeDirector(bblState storage.State) error
CreateDirector(bblState storage.State, terraformOutputs terraform.Outputs) (storage.State, error)
InitializeJumpbox(bblState storage.State) error
CleanUpDirector(state storage.State) error
CreateJumpbox(bblState storage.State, terraformOutputs terraform.Outputs) (storage.State, error)
DeleteDirector(bblState storage.State, terraformOutputs terraform.Outputs) error
DeleteJumpbox(bblState storage.State, terraformOutputs terraform.Outputs) error
GetDirectorDeploymentVars(bblState storage.State, terraformOutputs terraform.Outputs) string
GetJumpboxDeploymentVars(bblState storage.State, terraformOutputs terraform.Outputs) string
Path() string
Version() (string, error)
}
type envIDManager interface {
Sync(storage.State, string) (storage.State, error)
}
type environmentValidator interface {
Validate(state storage.State) error
}
type terraformManagerError interface {
Error() string
BBLState() (storage.State, error)
}
type vpcStatusChecker interface {
ValidateSafeToDelete(vpcID string, envID string) error
}
type certificateDeleter interface {
Delete(certificateName string) error
}
type stateValidator interface {
Validate() error
}
type certificateValidator interface {
ReadAndValidate(certPath, keyPath, chainPath string) (certs.CertData, error)
Read(certPath, keyPath, chainPath string) (certs.CertData, error)
ReadPKCS12(certPath, passwordPath string) (certs.CertData, error)
ReadAndValidatePKCS12(certPath, passwordPath string) (certs.CertData, error)
}
type lbArgsHandler interface {
GetLBState(string, LBArgs) (storage.LB, error)
Merge(storage.LB, storage.LB) storage.LB
}
type createLBsCmd interface {
Execute(state storage.State) error
}
type logger interface {
Step(string, ...interface{})
Printf(string, ...interface{})
Println(string)
Prompt(string) bool
}
type stateStore interface {
Set(state storage.State) error
GetOldBblDir() string
GetVarsDir() (string, error)
GetCloudConfigDir() (string, error)
}
type cloudConfigManager interface {
Update(state storage.State) error
Initialize(state storage.State) error
IsPresentCloudConfig() bool
IsPresentCloudConfigVars() bool
}
type runtimeConfigManager interface {
Initialize(state storage.State) error
Update(state storage.State) error
}