-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheureka.go
88 lines (75 loc) · 4.23 KB
/
eureka.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
package eureka
type Applications struct {
VersionsDelta string `json:"versions__delta" xml:"versions__delta"`
AppsHashcode string `json:"apps__hashcode" xml:"apps__hashcode"`
Applications []Application `json:"application,omitempty" xml:"application,omitempty"`
}
type Application struct {
Name string `json:"name" xml:"name"`
Instances []InstanceInfo `json:"instance" xml:"instance"`
}
type PortWrapper struct {
Enabled string `json:"@enabled" xml:",chardata"`
Port int `json:"$" xml:"enabled,attr"`
}
type DataCenterName string
const (
DataCenterNetflix DataCenterName = "Netflix"
DataCenterAmazon DataCenterName = "Amazon"
DataCenterMyOwn DataCenterName = "MyOwn"
)
type DataCenterInfo struct {
Name DataCenterName `json:"name" xml:"name"`
Class string `json:"@class" xml:"class,attr"`
}
type InstanceStatus string
const (
InstanceStatusUp InstanceStatus = "UP"
InstanceStatusDown InstanceStatus = "DOWN"
InstanceStatusStarting InstanceStatus = "STARTING"
InstanceStatusOutOfService InstanceStatus = "OUT_OF_SERVICE"
InstanceStatusUnknown InstanceStatus = "UNKNOWN"
)
type Metadata struct {
}
type LeaseInfo struct {
RenewalIntervalInSecs int `json:"renewalIntervalInSecs,omitempty" xml:"renewalIntervalInSecs,omitempty"`
DurationInSecs int `json:"durationInSecs,omitempty" xml:"durationInSecs,omitempty"`
RegistrationTimestamp int `json:"registrationTimestamp,omitempty" xml:"registrationTimestamp,omitempty"`
LastRenewalTimestamp int `json:"lastRenewalTimestamp,omitempty" xml:"lastRenewalTimestamp,omitempty"`
LastRenewalTimestampLegacy int `json:"renewalTimestamp,omitempty" xml:"renewalTimestamp,omitempty"`
EvictionTimestamp int `json:"evictionTimestamp,omitempty" xml:"evictionTimestamp,omitempty"`
ServiceUpTimestamp int `json:"serviceUpTimestamp,omitempty" xml:"serviceUpTimestamp,omitempty"`
}
type ActionType string
const (
ActionAdded ActionType = "ADDED"
ActionModified ActionType = "MODIFIED"
ActionDeleted ActionType = "DELETED"
)
type InstanceInfo struct {
InstanceId string `json:"instanceId,omitempty" xml:"instanceId,omitempty"`
AppName string `json:"app" xml:"app"`
AppGroupName string `json:"appGroupName" xml:"appGroupName"`
IpAddr string `json:"ipAddr" xml:"ipAddr"`
Port *PortWrapper `json:"port" xml:"port"`
SecurePort *PortWrapper `json:"securePort" xml:"securePort"`
HomePageUrl string `json:"homePageUrl" xml:"homePageUrl"`
StatusPageUrl string `json:"statusPageUrl" xml:"statusPageUrl"`
HealthCheckUrl string `json:"healthCheckUrl" xml:"healthCheckUrl"`
SecureHealthCheckUrl string `json:"secureHealthCheckUrl" xml:"secureHealthCheckUrl"`
VipAddress string `json:"vipAddress" xml:"vipAddress"`
SecureVipAddress string `json:"secureVipAddress" xml:"secureVipAddress"`
CountryId int `json:"countryId" xml:"countryId"`
DataCenterInfo *DataCenterInfo `json:"dataCenterInfo" xml:"dataCenterInfo"`
HostName string `json:"hostName" xml:"hostName"`
Status InstanceStatus `json:"status" xml:"status"`
OverriddenStatus InstanceStatus `json:"overriddenstatus" xml:"overriddenstatus"`
LeaseInfo *LeaseInfo `json:"leaseInfo" xml:"leaseInfo"`
IsCoordinatingDiscoveryServer string `json:"isCoordinatingDiscoveryServer" xml:"isCoordinatingDiscoveryServer"`
Metadata map[string]string `json:"metadata,omitempty" xml:"metadata,omitempty"`
LastUpdatedTimestamp string `json:"lastUpdatedTimestamp" xml:"lastUpdatedTimestamp"`
LastDirtyTimestamp string `json:"lastDirtyTimestamp" xml:"lastDirtyTimestamp"`
ActionType ActionType `json:"actionType" xml:"actionType"`
AsgName string `json:"asgName" xml:"asgName"`
}