-
Notifications
You must be signed in to change notification settings - Fork 53
/
struct.go
39 lines (31 loc) · 1.06 KB
/
struct.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
package shared
import (
"fmt"
"github.com/samber/lo"
)
type AlertingClusterNotification lo.Tuple2[bool, *AlertingClusterOptions]
type AlertingClusterOptions struct {
Namespace string
WorkerNodesService string
WorkerNodePort int
WorkerStatefulSet string
ControllerNodeService string
ControllerNodePort int
ControllerClusterPort int
ControllerStatefulSet string
OpniPort int
ConfigMap string
ManagementHookHandler string
}
func (a *AlertingClusterOptions) GetInternalControllerOpniEndpoint() string {
return fmt.Sprintf("%s:%d", a.ControllerNodeService, AlertingDefaultHookPort)
}
func (a *AlertingClusterOptions) GetInternalWorkerOpniEndpoint() string {
return fmt.Sprintf("%s:%d", a.WorkerNodesService, AlertingDefaultHookPort)
}
func (a *AlertingClusterOptions) GetControllerEndpoint() string {
return fmt.Sprintf("%s:%d", a.ControllerNodeService, a.ControllerNodePort)
}
func (a *AlertingClusterOptions) GetWorkerEndpoint() string {
return fmt.Sprintf("%s:%d", a.WorkerNodesService, a.WorkerNodePort)
}