eureka

package
v0.0.0-...-157c77b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

type ApplicationsResponse

type ApplicationsResponse struct {
	Version      string        `json:"versions__delta"`
	AppsHashcode string        `json:"apps__hashcode"`
	Applications []Application `json:"application"`
}

type ApplicationsRootResponse

type ApplicationsRootResponse struct {
	ApplicationsResponse `json:"applications"`
}

ApplicationsRootResponse for /eureka/apps

type DataCenterInfo

type DataCenterInfo struct {
	Name  string `json:"name"`
	Class string `json:"@class"`
}

type EurekaDiscovery

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

func NewEurekaDiscovery

func NewEurekaDiscovery(options *regOps.DiscoveryOptions) *EurekaDiscovery

func (*EurekaDiscovery) GetService

func (d *EurekaDiscovery) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)

GetService get services from eureka

func (*EurekaDiscovery) GetServiceInstances

func (d *EurekaDiscovery) GetServiceInstances(ctx context.Context, serverName string) []Instance

func (*EurekaDiscovery) Subscribe

func (d *EurekaDiscovery) Subscribe(serverName string, fn func()) error

func (*EurekaDiscovery) Unsubscribe

func (d *EurekaDiscovery) Unsubscribe(serverName string)

func (*EurekaDiscovery) Watch

func (d *EurekaDiscovery) Watch(ctx context.Context, serviceName string) (registry.Watcher, error)

Watch 是独立的ctx

type Instance

type Instance struct {
	InstanceID     string            `json:"instanceId"`
	HostName       string            `json:"hostName"`
	Port           Port              `json:"port"`
	App            string            `json:"app"`
	IPAddr         string            `json:"ipAddr"`
	VipAddress     string            `json:"vipAddress"`
	Status         string            `json:"status"`
	SecurePort     Port              `json:"securePort"`
	HomePageURL    string            `json:"homePageUrl"`
	StatusPageURL  string            `json:"statusPageUrl"`
	HealthCheckURL string            `json:"healthCheckUrl"`
	DataCenterInfo DataCenterInfo    `json:"dataCenterInfo"`
	Metadata       map[string]string `json:"metadata"`
}

type Port

type Port struct {
	Port    int    `json:"$"`
	Enabled string `json:"@enabled"`
}

Jump to

Keyboard shortcuts

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