forked from redhat-developer/odo
/
fakeConfig.go
99 lines (86 loc) · 2.29 KB
/
fakeConfig.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
package config
func GetOneExistingConfigInfo(componentName, applicationName, projectName string) LocalConfigInfo {
componentType := "nodejs"
sourceLocation := "./"
storageValue := []ComponentStorageSettings{
{
Name: "example-storage-0",
},
{
Name: "example-storage-1",
},
}
portsValue := []string{"8080/TCP", "45/UDP"}
urlValue := []ConfigURL{
{
Name: "example-url-0",
Port: 8080,
},
{
Name: "example-url-1",
Port: 45,
},
}
envVars := EnvVarList{
EnvVar{Name: "env-0", Value: "value-0"},
EnvVar{Name: "env-1", Value: "value-1"},
}
localVar := LOCAL
return LocalConfigInfo{
configFileExists: true,
LocalConfig: LocalConfig{
componentSettings: ComponentSettings{
Name: &componentName,
Application: &applicationName,
Type: &componentType,
SourceLocation: &sourceLocation,
Storage: &storageValue,
Envs: envVars,
Ports: &portsValue,
URL: &urlValue,
Project: &projectName,
SourceType: &localVar,
},
},
}
}
func GetOneExistingConfigInfoStorage(componentName, applicationName, projectName, storeName, storeSize, storePath string) LocalConfigInfo {
componentType := "nodejs"
sourceLocation := "./"
storageValue := []ComponentStorageSettings{
{
Name: storeName,
Size: storeSize,
Path: storePath,
},
}
localVar := LOCAL
return LocalConfigInfo{
configFileExists: true,
LocalConfig: LocalConfig{
componentSettings: ComponentSettings{
Name: &componentName,
Application: &applicationName,
Type: &componentType,
SourceLocation: &sourceLocation,
Storage: &storageValue,
Project: &projectName,
SourceType: &localVar,
},
},
}
}
func GetOneGitExistingConfigInfo(componentName, applicationName, projectName string) LocalConfigInfo {
localConfigInfo := GetOneExistingConfigInfo(componentName, applicationName, projectName)
git := GIT
location := "https://example.com"
localConfigInfo.LocalConfig.componentSettings.SourceType = &git
localConfigInfo.LocalConfig.componentSettings.SourceLocation = &location
return localConfigInfo
}
func GetOneNonExistingConfigInfo() LocalConfigInfo {
return LocalConfigInfo{
configFileExists: false,
LocalConfig: LocalConfig{},
}
}