/
types.go
116 lines (105 loc) · 2.2 KB
/
types.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
114
115
116
/*
Copyright 2021 The KodeRover Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package setting
import "regexp"
type Request string
const (
// HighRequest 16 CPU 32 G
HighRequest Request = "high"
// MediumRequest 8 CPU 16 G
MediumRequest Request = "medium"
// LowRequest 4 CPU 8 G
LowRequest Request = "low"
// MinRequest 2 CPU 2 G
MinRequest Request = "min"
)
var ValidName = regexp.MustCompile(`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$`)
var ValidNameHint = "a valid name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
const (
Aslan = iota + 1 // 1
Aslanx // 2
Clair // 3
Collie // 4
Cron // 5
HubServer // 6
PodExec // 7
SonarQube // 9
WarpDrive // 10
Minio // 11
OPA // 12
Policy // 13
Config // 14
User // 15
)
type ServiceInfo struct {
Name string
Port int32
}
var Services = map[int]*ServiceInfo{
Aslan: {
Name: "aslan",
Port: 25000,
},
Aslanx: {
Name: "aslanx",
Port: 25002,
},
Clair: {
Name: "clair",
Port: 34002,
},
Collie: {
Name: "collie-server",
Port: 28080,
},
Cron: {
Name: "cron",
Port: 80,
},
HubServer: {
Name: "hub-server",
Port: 26000,
},
PodExec: {
Name: "podexec",
Port: 27000,
},
SonarQube: {
Name: "sonarqube",
Port: 80,
},
WarpDrive: {
Name: "warpdrive",
Port: 80,
},
Minio: {
Name: "zadig-minio",
Port: 9000,
},
OPA: {
Name: "opa",
Port: 8181,
},
Policy: {
Name: "policy",
Port: 80,
},
Config: {
Name: "config",
Port: 80,
},
User: {
Name: "user",
Port: 80,
},
}