eureka

package
v0.0.0-...-daa393d Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: CC-BY-SA-4.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UP      = "UP"
	DOWN    = "DOWN"
	UNKNOWN = "UNKNOWN"
)

Variables

This section is empty.

Functions

func GetInstanceURL

func GetInstanceURL(host, id string) (string, error)

func RegisterInstance

func RegisterInstance(eurekaHost string, instance *Instance) error

func UnregisterApp

func UnregisterApp(eurekaHost, app, hostName string) error

Example: localhost:8761, foo-service, FOO:8081

Types

type Application

type Application struct {
	XMLName   xml.Name    `json:"-" xml:"application"`
	Name      string      `json:"name" xml:"name"`
	Instances []*Instance `json:"instance" xml:"instance"`
}

func (*Application) ReplaceInstances

func (app *Application) ReplaceInstances(newInstances []*Instance)

type Applications

type Applications struct {
	XMLName      xml.Name       `json:"-" xml:"applications"`
	Version      interface{}    `json:"versions__delta" xml:"versions__delta"`
	Status       string         `json:"apps__hashcode" xml:"apps__hashcode"`
	Applications []*Application `json:"application" xml:"application"`
}

func (*Applications) AddApp

func (a *Applications) AddApp(app ...*Application)

func (*Applications) ContainsApp

func (a *Applications) ContainsApp(ID string) (bool, *Application)

type DataCenter

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

func DefaultDataCenter

func DefaultDataCenter() *DataCenter

type Instance

type Instance struct {
	InstanceID                    string      `json:"instanceId" xml:"instanceId"`
	HostName                      string      `json:"hostName" xml:"hostName"`
	App                           string      `json:"app" xml:"app"`
	IPAddress                     string      `json:"ipAddr" xml:"ipAddr"`
	Status                        Status      `json:"status" xml:"status"`
	OverriddenStatus              Status      `json:"overriddenstatus" xml:"overriddenstatus"`
	Port                          *Port       `json:"port,omitempty" xml:"port,omitempty"`
	SecurePort                    *Port       `json:"securePort,omitempty" xml:"securePort,omitempty"`
	CountryID                     int         `json:"countryId" xml:"countryId"`
	DataCenter                    *DataCenter `json:"dataCenterInfo" xml:"dataCenterInfo"`
	Lease                         *Lease      `json:"leaseInfo" xml:"leaseInfo"`
	MetaData                      *MetaData   `json:"metadata" xml:"metadata"`
	HomePageURL                   string      `json:"homePageUrl" xml:"homePageUrl"`
	StatusPageURL                 string      `json:"statusPageUrl" xml:"statusPageUrl"`
	HealthCheckURL                string      `json:"healthCheckUrl" xml:"healthCheckUrl"`
	VIPAddress                    string      `json:"vipAddress" xml:"vipAddress"`
	SecureVIPAddress              string      `json:"secureVipAddress" xml:"secureVipAddress"`
	IsCoordinatingDiscoveryServer string      `json:"isCoordinatingDiscoveryServer" xml:"isCoordinatingDiscoveryServer"`
	LastUpdatedTimestamp          string      `json:"lastUpdatedTimestamp" xml:"lastUpdatedTimestamp"`
	LastDirtyTimestamp            string      `json:"lastDirtyTimestamp" xml:"lastDirtyTimestamp"`
	ActionType                    string      `json:"actionType" xml:"actionType"`
}

Information about a single instance.

func NewInstance

func NewInstance(id, ip, hostName string, port int) *Instance

type Lease

type Lease struct {
	RenewalIntervalInSecs int
	DurationInSecs        int
	RegistrationTimestamp int
	LastRenewalTimestamp  int
	EvictionTimestamp     int
	ServiceUpTimestamp    int
}

func DefaultLease

func DefaultLease() *Lease

type MetaData

type MetaData struct {
	InstanceID string `json:"instanceId" xml:"instanceId"`
}

func NewMetaData

func NewMetaData(ID string, port int) *MetaData

type Port

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

func NewPort

func NewPort(number int) *Port

func SecurePort

func SecurePort() *Port

type RegistrationRequest

type RegistrationRequest struct {
	Instance *Instance `json:"instance" xml:"instance"`
}

A request that is send when a service should be registered in eureka.

type State

type State struct {
	Apps *Applications `json:"applications"`
}

type Status

type Status string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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