eureka

package module
v0.0.0-...-d5a8746 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

procyon-eureka-client

Procyon Eureka Client

Documentation

Index

Constants

View Source
const (
	DefaultPrefix = "/eureka"
	DefaultUrl    = "http://localhost:8761" + DefaultPrefix + "/"
	DefaultZone   = "defaultZone"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string
const (
	ActionAdded    ActionType = "ADDED"
	ActionModified ActionType = "MODIFIED"
	ActionDeleted  ActionType = "DELETED"
)

type Application

type Application struct {
	Name      string         `json:"name" xml:"name"`
	Instances []InstanceInfo `json:"instance" xml:"instance"`
}

type ApplicationResource

type ApplicationResource struct {
	Application *Application `json:"application,omitempty" xml:"application,omitempty"`
}

type Applications

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 ApplicationsResource

type ApplicationsResource struct {
	Applications *Applications `json:"applications,omitempty" xml:"applications,omitempty"`
}

type ClientProperties

type ClientProperties struct {
	RegistryWithEureka bool `json:"registryWithEureka,omitempty" yaml:"registryWithEureka,omitempty"`
	FetchRegistry      bool `json:"fetchRegistry,omitempty" yaml:"fetchRegistry,omitempty"`
}

func (*ClientProperties) GetConfigurationPrefix

func (clientConfiguration *ClientProperties) GetConfigurationPrefix() string

type DataCenterInfo

type DataCenterInfo struct {
	Name  DataCenterName `json:"name" xml:"name"`
	Class string         `json:"@class" xml:"class,attr"`
}

type DataCenterName

type DataCenterName string
const (
	DataCenterNetflix DataCenterName = "Netflix"
	DataCenterAmazon  DataCenterName = "Amazon"
	DataCenterMyOwn   DataCenterName = "MyOwn"
)

type DefaultHttpClient

type DefaultHttpClient struct {
	// contains filtered or unexported fields
}

func (DefaultHttpClient) Deregister

func (httpClient DefaultHttpClient) Deregister(appName, instanceId string) error

func (DefaultHttpClient) GetApplication

func (httpClient DefaultHttpClient) GetApplication(appName string) (*Application, error)

func (DefaultHttpClient) GetApplications

func (httpClient DefaultHttpClient) GetApplications(regions ...string) (*Applications, error)

func (DefaultHttpClient) GetInstanceByAppNameAndInstanceId

func (httpClient DefaultHttpClient) GetInstanceByAppNameAndInstanceId(appName, instanceId string) (*InstanceInfo, error)

func (DefaultHttpClient) GetInstanceByInstanceId

func (httpClient DefaultHttpClient) GetInstanceByInstanceId(instanceId string) (*InstanceInfo, error)

func (DefaultHttpClient) Register

func (httpClient DefaultHttpClient) Register(info *InstanceInfo) error

func (DefaultHttpClient) SendHeartBeat

func (httpClient DefaultHttpClient) SendHeartBeat(appName, instanceId string, info *InstanceInfo, overriddenStatus InstanceStatus) error

func (DefaultHttpClient) UpdateStatus

func (httpClient DefaultHttpClient) UpdateStatus(appName, instanceId string, newStatus InstanceStatus, info *InstanceInfo) error

type DefaultInstanceInfoProvider

type DefaultInstanceInfoProvider struct {
	// contains filtered or unexported fields
}

func (*DefaultInstanceInfoProvider) GetInstanceInfo

func (provider *DefaultInstanceInfoProvider) GetInstanceInfo() *InstanceInfo

type DiscoveryClient

type DiscoveryClient struct {
	// contains filtered or unexported fields
}

func (DiscoveryClient) GetDescription

func (discoveryClient DiscoveryClient) GetDescription() string

func (DiscoveryClient) GetServiceInstances

func (discoveryClient DiscoveryClient) GetServiceInstances(serviceId string) []cloud.ServiceInstance

func (DiscoveryClient) GetServices

func (discoveryClient DiscoveryClient) GetServices() []string

type Error

type Error struct {
	Message string `json:"error,omitempty" xml:"error,omitempty"`
}

type HttpClient

type HttpClient interface {
	Register(info *InstanceInfo) error
	Deregister(appName, instanceId string) error
	SendHeartBeat(appName, instanceId string, info *InstanceInfo, overriddenStatus InstanceStatus) error
	UpdateStatus(appName, instanceId string, newStatus InstanceStatus, info *InstanceInfo) error
	GetApplication(appName string) (*Application, error)
	GetInstanceByAppNameAndInstanceId(appName, instanceId string) (*InstanceInfo, error)
	GetInstanceByInstanceId(instanceId string) (*InstanceInfo, error)
	GetApplications(regions ...string) (*Applications, error)
}

type InstanceInfo

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"`
}

type InstanceInfoProvider

type InstanceInfoProvider interface {
	GetInstanceInfo() *InstanceInfo
}

type InstanceProperties

type InstanceProperties struct {
	ApplicationName      string         `json:"appName,omitempty" yaml:"appName,omitempty"`
	ApplicationGroupName string         `json:"appGroupName,omitempty" yaml:"appGroupName,omitempty"`
	IpAddr               string         `json:"ipAddr,omitempty" yaml:"ipAddr,omitempty"`
	DataCenterInfo       DataCenterInfo `json:"dataCenterInfo,omitempty" yaml:"dataCenterInfo,omitempty"`
	SecurePort           int            `json:"securePort,omitempty" yaml:"securePort,omitempty"`
	NonSecurePort        int            `json:"nonSecurePort,omitempty" yaml:"nonSecurePort,omitempty"`
	NonSecurePortEnabled bool           `json:"nonSecurePortEnabled,omitempty" yaml:"nonSecurePortEnabled,omitempty"`
	SecurePortEnabled    bool           `json:"securePortEnabled,omitempty" yaml:"securePortEnabled,omitempty"`
	InstanceId           string         `json:"instanceId,omitempty" yaml:"instanceId,omitempty"`
	StatusPageUrl        string         `json:"statusPageUrl,omitempty" yaml:"statusPageUrl,omitempty"`
	HomePageUrl          string         `json:"homePageUrl,omitempty" yaml:"homePageUrl,omitempty"`
	HealthCheckUrl       string         `json:"healthCheckUrl,omitempty" yaml:"healthCheckUrl,omitempty"`
	Hostname             string         `json:"hostname,omitempty" yaml:"hostname,omitempty"`
}

func (*InstanceProperties) GetConfigurationPrefix

func (instanceProperties *InstanceProperties) GetConfigurationPrefix() string

type InstanceResource

type InstanceResource struct {
	InstanceInfo *InstanceInfo `json:"instance,omitempty" xml:"instance,omitempty"`
}

type InstanceStatus

type InstanceStatus string
const (
	InstanceStatusUp           InstanceStatus = "UP"
	InstanceStatusDown         InstanceStatus = "DOWN"
	InstanceStatusStarting     InstanceStatus = "STARTING"
	InstanceStatusOutOfService InstanceStatus = "OUT_OF_SERVICE"
	InstanceStatusUnknown      InstanceStatus = "UNKNOWN"
)

type LeaseInfo

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 Metadata

type Metadata struct {
}

type PortWrapper

type PortWrapper struct {
	Enabled string `json:"@enabled" xml:",chardata"`
	Port    int    `json:"$" xml:"enabled,attr"`
}

type ServiceInstance

type ServiceInstance struct {
	// contains filtered or unexported fields
}

func (ServiceInstance) GetHost

func (serviceInstance ServiceInstance) GetHost() string

func (ServiceInstance) GetInstanceId

func (serviceInstance ServiceInstance) GetInstanceId() string

func (ServiceInstance) GetMetadata

func (serviceInstance ServiceInstance) GetMetadata() map[string]string

func (ServiceInstance) GetPort

func (serviceInstance ServiceInstance) GetPort() int

func (ServiceInstance) GetScheme

func (serviceInstance ServiceInstance) GetScheme() string

func (ServiceInstance) GetServiceId

func (serviceInstance ServiceInstance) GetServiceId() string

func (ServiceInstance) GetURL

func (serviceInstance ServiceInstance) GetURL() url.URL

func (ServiceInstance) IsSecure

func (serviceInstance ServiceInstance) IsSecure() bool

type ServiceRegistry

type ServiceRegistry struct {
}

func (ServiceRegistry) Deregister

func (serviceRegistry ServiceRegistry) Deregister(instance cloud.ServiceInstance)

func (ServiceRegistry) GetStatus

func (serviceRegistry ServiceRegistry) GetStatus(instance cloud.ServiceInstance) interface{}

func (ServiceRegistry) Register

func (serviceRegistry ServiceRegistry) Register(instance cloud.ServiceInstance)

func (ServiceRegistry) SetStatus

func (serviceRegistry ServiceRegistry) SetStatus(instance cloud.ServiceInstance, status string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL