eureka

package
v0.0.0-...-675a1a6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSDConfig = SDConfig{
	RefreshInterval: model.Duration(30 * time.Second),
}

DefaultSDConfig is the default Eureka SD configuration.

Functions

This section is empty.

Types

type Application

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

type Applications

type Applications struct {
	VersionsDelta int           `xml:"versions__delta"`
	AppsHashcode  string        `xml:"apps__hashcode"`
	Applications  []Application `xml:"application"`
}

type DataCenterInfo

type DataCenterInfo struct {
	Name     string    `xml:"name"`
	Class    string    `xml:"class,attr"`
	Metadata *MetaData `xml:"metadata"`
}

type Discovery

type Discovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

Discovery provides service discovery based on a Eureka instance.

func NewDiscovery

func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error)

New creates a new Eureka discovery for the given role.

type Instance

type Instance struct {
	HostName                      string          `xml:"hostName"`
	HomePageURL                   string          `xml:"homePageUrl"`
	StatusPageURL                 string          `xml:"statusPageUrl"`
	HealthCheckURL                string          `xml:"healthCheckUrl"`
	App                           string          `xml:"app"`
	IPAddr                        string          `xml:"ipAddr"`
	VipAddress                    string          `xml:"vipAddress"`
	SecureVipAddress              string          `xml:"secureVipAddress"`
	Status                        string          `xml:"status"`
	Port                          *Port           `xml:"port"`
	SecurePort                    *Port           `xml:"securePort"`
	DataCenterInfo                *DataCenterInfo `xml:"dataCenterInfo"`
	Metadata                      *MetaData       `xml:"metadata"`
	IsCoordinatingDiscoveryServer bool            `xml:"isCoordinatingDiscoveryServer"`
	ActionType                    string          `xml:"actionType"`
	CountryID                     int             `xml:"countryId"`
	InstanceID                    string          `xml:"instanceId"`
}

type MetaData

type MetaData struct {
	Items []Tag `xml:",any"`
}

type Port

type Port struct {
	Port    int  `xml:",chardata"`
	Enabled bool `xml:"enabled,attr"`
}

type SDConfig

type SDConfig struct {
	Server           string                  `yaml:"server,omitempty"`
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
	RefreshInterval  model.Duration          `yaml:"refresh_interval,omitempty"`
}

SDConfig is the configuration for applications running on Eureka.

func (*SDConfig) Name

func (*SDConfig) Name() string

Name returns the name of the Config.

func (*SDConfig) NewDiscoverer

func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)

NewDiscoverer returns a Discoverer for the Config.

func (*SDConfig) SetDirectory

func (c *SDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*SDConfig) UnmarshalYAML

func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Tag

type Tag struct {
	XMLName xml.Name
	Content string `xml:",innerxml"`
}

Jump to

Keyboard shortcuts

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