Documentation
¶
Index ¶
- Constants
- func ApplicationURL(token, appid string) string
- func InstanceStatusURL(token, appid, id string) string
- func InstanceURL(token, appid, id string) string
- func Translate(inst *Instance) (*store.ServiceInstance, error)
- type Application
- type Applications
- type ApplicationsList
- type DatacenterInfo
- type DatacenterMetadata
- type Instance
- type InstanceWrapper
- type LeaseInfo
- type Port
- type Routes
- type UniqueIdentifier
Constants ¶
const ( RouteParamToken = "token" RouteParamAppID = "appid" RouteParamInstanceID = "iid" RouterParamVip = "vip" )
Eureka API parameter names
Variables ¶
This section is empty.
Functions ¶
func ApplicationURL ¶
ApplicationURL returns (client side) URL path used for creating new instance registrations
func InstanceStatusURL ¶
InstanceStatusURL returns (client side) URL path used for setting instance status
func InstanceURL ¶
InstanceURL returns (client side) URL path used for interacting with the specified instance
func Translate ¶ added in v0.4.0
func Translate(inst *Instance) (*store.ServiceInstance, error)
Translate translates eureka instance into store instance
Types ¶
type Application ¶
type Application struct {
Name string `json:"name,omitempty"`
Instances []*Instance `json:"instance,omitempty"`
}
Application is an array of instances
func (*Application) UnmarshalJSON ¶ added in v0.4.0
func (app *Application) UnmarshalJSON(b []byte) error
UnmarshalJSON parses the JSON object of Application struct. We need this specific implementation because the Eureka server marshals differently single instance (object) and multiple instances (array).
type Applications ¶
type Applications struct {
Application []*Application `json:"application,omitempty"`
// contains filtered or unexported fields
}
Applications is an array of application objects
func (*Applications) UnmarshalJSON ¶ added in v0.4.0
func (apps *Applications) UnmarshalJSON(b []byte) error
UnmarshalJSON parses the JSON object of Applications struct. We need this specific implementation because the Eureka server marshals differently single application (object) and multiple applications (array).
type ApplicationsList ¶
type ApplicationsList struct {
Applications *Applications `json:"applications,omitempty"`
}
ApplicationsList is a list of application objects
type DatacenterInfo ¶
type DatacenterInfo struct {
Class string `json:"@class,omitempty"`
Name string `json:"name,omitempty"`
Metadata DatacenterMetadata `json:"metadata,omitempty"`
}
DatacenterInfo encapsulates information needed for a datacenter information
type DatacenterMetadata ¶ added in v0.4.0
type DatacenterMetadata map[string]interface{}
DatacenterMetadata encapsulates information needed for a datacenter metadata information
type Instance ¶
type Instance struct {
ID string `json:"instanceId,omitempty"`
HostName string `json:"hostName,omitempty"`
Application string `json:"app,omitempty"`
GroupName string `json:"appGroupName,omitempty"`
IPAddr string `json:"ipAddr,omitempty"`
VIPAddr string `json:"vipAddress,omitempty"`
SecVIPAddr string `json:"secureVipAddress,omitempty"`
Status string `json:"status,omitempty"`
OvrStatus string `json:"overriddenstatus,omitempty"`
CountryID int `json:"countryId,omitempty"`
Port *Port `json:"port,omitempty"`
SecPort *Port `json:"securePort,omitempty"`
HomePage string `json:"homePageUrl,omitempty"`
StatusPage string `json:"statusPageUrl,omitempty"`
HealthCheck string `json:"healthCheckUrl,omitempty"`
Datacenter *DatacenterInfo `json:"dataCenterInfo,omitempty"`
Lease *LeaseInfo `json:"leaseInfo,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
CordServer interface{} `json:"isCoordinatingDiscoveryServer,omitempty"`
LastUpdatedTs interface{} `json:"lastUpdatedTimestamp,omitempty"`
LastDirtyTs interface{} `json:"lastDirtyTimestamp,omitempty"`
ActionType string `json:"actionType,omitempty"`
}
Instance encapsulates information needed for a service instance information
type InstanceWrapper ¶
type InstanceWrapper struct {
Inst *Instance `json:"instance,omitempty"`
}
InstanceWrapper encapsulates information needed for a service instance registration
type LeaseInfo ¶
type LeaseInfo struct {
RenewalInt uint32 `json:"renewalIntervalInSecs,omitempty"`
DurationInt uint32 `json:"durationInSecs,omitempty"`
RegistrationTs int64 `json:"registrationTimestamp,omitempty"`
LastRenewalTs int64 `json:"lastRenewalTimestamp,omitempty"`
}
LeaseInfo encapsulates information needed for a lease information
type Port ¶
type Port struct {
Enabled string `json:"@enabled,omitempty"`
Value interface{} `json:"$,omitempty"`
}
Port encapsulates information needed for a port information
type Routes ¶
type Routes struct {
// contains filtered or unexported fields
}
Routes encapsulates information needed for the eureka protocol routes
type UniqueIdentifier ¶
type UniqueIdentifier interface {
GetID(dcinfo *DatacenterInfo) string
}
UniqueIdentifier indicates the unique ID of the datacenter information
Source Files
¶
- amazon_dcinfo.go
- app_handler.go
- application.go
- applications.go
- applications_list.go
- dctype_resolver.go
- endpoints.go
- instance.go
- instance_handler.go
- routes.go
- softlayer_dcinfo.go
- vip_handler.go