generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 95
/
controllers.go
52 lines (47 loc) · 1.35 KB
/
controllers.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
package controllers
type MesheryControllerStatus int
const (
Deployed MesheryControllerStatus = iota //The controller is deployed(default behavior)
Deploying //The controller is being deployed
NotDeployed //The controller is not deployed yet
Undeployed //The controller has been intentionally undeployed. This state is useful to avoid automatic redeployment.
// we don't know since we have not checked yet
Enabled
Running
Connected
Unknown
)
const (
MeshSync = "meshsync"
MesheryBroker = "meshery-broker"
MesheryServer = "meshery-server"
)
func (mcs MesheryControllerStatus) String() string {
switch mcs {
case Deployed:
return "Deployed"
case Deploying:
return "Deploying"
case NotDeployed:
return "Not Deployed"
case Undeployed:
return "Undeployed"
case Enabled:
return "Enabled"
case Running:
return "Running"
case Connected:
return "Connected"
case Unknown:
return "Unknown"
}
return "unknown"
}
type IMesheryController interface {
GetName() string
GetStatus() MesheryControllerStatus
Deploy(force bool) error //If force is set to false && controller is in "Undeployed", then Deployment will be skipped. Set force=true for explicit install.
Undeploy() error
GetPublicEndpoint() (string, error)
GetVersion() (string, error)
}