/
migratorv4Utils_mock.go
57 lines (55 loc) · 2.47 KB
/
migratorv4Utils_mock.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
package migratorv4
type MockMigratorV4UtilsImpl struct {
GetEsTotalShardSettingsFunc func(path string) (int32, error)
PatchOpensearchConfigFunc func(es *ESSettings) (string, string, error)
IsExternalElasticSearchFunc func(timeout int64) bool
StopAutomateFunc func() error
StartAutomateFunc func() error
ReadV4ChecklistFunc func(id, path string) (bool, error)
UpdatePostChecklistFileFunc func(id, path string) error
ExecuteCommandFunc func(command string, args []string, workingDir string) error
GetServicesStatusFunc func() (bool, error)
CreateMigrateJsonFunc func() error
GetAutomateFQDNFunc func(timeout int64) string
GetMaintenanceStatusFunc func(timeout int64) (bool, error)
SetMaintenanceModeFunc func(timeout int64, status bool) (stdOut, stdErr string, err error)
}
func (mui *MockMigratorV4UtilsImpl) GetEsTotalShardSettings(path string) (int32, error) {
return mui.GetEsTotalShardSettingsFunc(path)
}
func (mui *MockMigratorV4UtilsImpl) PatchOpensearchConfig(es *ESSettings) (string, string, error) {
return mui.PatchOpensearchConfigFunc(es)
}
func (mui *MockMigratorV4UtilsImpl) IsExternalElasticSearch(timeout int64) bool {
return mui.IsExternalElasticSearchFunc(timeout)
}
func (mui *MockMigratorV4UtilsImpl) StopAutomate() error {
return mui.StopAutomateFunc()
}
func (mui *MockMigratorV4UtilsImpl) StartAutomate() error {
return mui.StartAutomateFunc()
}
func (mui *MockMigratorV4UtilsImpl) ReadV4Checklist(id, path string) (bool, error) {
return mui.ReadV4ChecklistFunc(id, path)
}
func (mui *MockMigratorV4UtilsImpl) UpdatePostChecklistFile(id, path string) error {
return mui.UpdatePostChecklistFileFunc(id, path)
}
func (mui *MockMigratorV4UtilsImpl) ExecuteCommand(command string, args []string, workingDir string) error {
return mui.ExecuteCommandFunc(command, args, workingDir)
}
func (mui *MockMigratorV4UtilsImpl) GetServicesStatus() (bool, error) {
return mui.GetServicesStatusFunc()
}
func (mui *MockMigratorV4UtilsImpl) CreateMigrateJson() error {
return mui.CreateMigrateJsonFunc()
}
func (mui *MockMigratorV4UtilsImpl) GetAutomateFQDN(timeout int64) string {
return mui.GetAutomateFQDNFunc(timeout)
}
func (mui *MockMigratorV4UtilsImpl) GetMaintenanceStatus(timeout int64) (bool, error) {
return mui.GetMaintenanceStatusFunc(timeout)
}
func (mui *MockMigratorV4UtilsImpl) SetMaintenanceMode(timeout int64, status bool) (stdOut, stdErr string, err error) {
return mui.SetMaintenanceModeFunc(timeout, status)
}