-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
39 lines (34 loc) · 1.37 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
package warden
type ServiceManager struct {
id string // instance ID
heartbeat string // timestamp of last heartbeat
subnet string // subnet that the instance belongs to
}
type ServiceDescription struct {
Name string `json:"name"`
BackendName string `json:"backendName"`
ContainerName string `json:"containerName"`
LoadBalancerName string `json:"loadBalancerName"`
LoadBalancerUrl string `json:"loadBalancerUrl"`
Port int `json:"port"`
Site string `json:"site"`
TaskName string `json:"taskName"`
TaskVersion int `json:"taskVersion"`
}
type ServiceDescriptionReader interface {
Read() []*ServiceDescription
}
// Configuration holds the basic environment information for Warden including Redis details and the name of the service description file
type Configuration struct {
ServiceManagementRedisAddress string `json:"serviceManagementRedisAddress"`
ServiceManagementRedisDatabaseNumber int64 `json:"serviceManagementRedisDatabaseNumber"`
NginxRedisAddress string `json:"nginxRedisAddress"`
NginxRedisDatabaseNumber int64 `json:"nginxRedisDatabaseNumber"`
ServiceDescriptionFilename string `json:"serviceDescriptionFilename"`
RegistrarSleepTimeSeconds int64 `json:"registrarSleepTimeSeconds"`
ManagerSleepTimeSeconds int64 `json:"managerSleepTimeSeconds"`
}
type Container struct {
Id string
IPAddress string
}