eureka

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeregisterWithEureka

func DeregisterWithEureka(config Config, username, password string) error

DeregisterWithEureka deregisters the Eureka instance.

func RegisterWithEureka

func RegisterWithEureka(config Config, username, password string) error

RegisterWithEureka registers the instance with Eureka.

Types

type Config

type Config struct {
	EurekaURL  string
	App        string
	Instance   InstanceData
	AuthHeader string // Custom authorization header
}

Config contains the configuration for registering with Eureka.

type DataCenterInfoData

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

DataCenterInfoData contains the data center data.

type InstanceData

type InstanceData struct {
	InstanceID       string             `json:"instanceId"`
	HostName         string             `json:"hostName"`
	App              string             `json:"app"`
	IPAddr           string             `json:"ipAddr"`
	Status           Status             `json:"status"`
	Port             PortData           `json:"port"`
	SecurePort       PortData           `json:"securePort"`
	HomePageURL      string             `json:"homePageUrl"`
	StatusPageURL    string             `json:"statusPageUrl"`
	HealthCheckURL   string             `json:"healthCheckUrl"`
	VIPAddress       string             `json:"vipAddress"`
	SecureVIPAddress string             `json:"secureVipAddress"`
	CountryID        int                `json:"countryId"`
	DataCenterInfo   DataCenterInfoData `json:"dataCenterInfo"`
}

InstanceData contains the data for the instance.

type PortData

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

PortData contains the port data.

type Status

type Status string

Status represents the status of the service instance.

const (
	StatusUp           Status = "UP"
	StatusDown         Status = "DOWN"
	StatusOutOfService Status = "OUT_OF_SERVICE"
)

Jump to

Keyboard shortcuts

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