model

package
v0.0.0-...-68fa315 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Amazon              = "Amazon"
	MyOwn               = "MyOwn"
	DataCenterInfoClass = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo"
)

Datacenter names

Variables

This section is empty.

Functions

This section is empty.

Types

type AmazonMetadata

type AmazonMetadata struct {
	Hostname         string `json:"hostname'`
	PublicHostName   string `json:"public-hostname"`
	LocalHostName    string `json:"local-hostname"`
	PublicIpv4       string `json:"public-ipv4'`
	LocalIpv4        string `json:"local-ipv4"`
	AvailabilityZone string `json:"availability-zone"`
	InstanceId       string `json:"instance-id"`
	InstanceType     string `json:"instance-type"`
	AmiId            string `json:"ami-id"`
	AmiLaunchIndex   string `json:"ami-launch-index"`
	AmiManifestPath  string `json:"ami-manifest-path"`
}

type Application

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

func (*Application) String

func (a *Application) String() string

type ApplicationResponse

type ApplicationResponse struct {
	Response *Application `json:"application"`
}

type Applications

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

type ApplicationsResponse

type ApplicationsResponse struct {
	Response *Applications `json:"applications"`
}

type DataCenterInfo

type DataCenterInfo struct {
	ClassName string          `json:"@class"`
	Name      string          `json:"name"`
	Metadata  *AmazonMetadata `json:"metadata,omitempty"`
}

type DataCenterInfoType

type DataCenterInfoType map[string]string

type PortType map[string]interface{}

type DataCenterType

type DataCenterType uint8

type EurekaClientConfig

type EurekaClientConfig struct {
	ServiceUrls         []string `json:"serviceUrls"`
	PollIntervalSeconds int      `json:"pollIntervalSeconds"`
	RegisterWithEureka  bool     `json:"registerWithEureka"`
	HealthCheckEnabled  bool     `json:"healthCheckEnabled"`
	Retries             int      `json:"retries"`
}

type EurekaConfig

type EurekaConfig struct {
	// Instance - Application Instance Information
	Instance EurekaInstanceConfig `json:"instance"`
	// Client - Eureka Client Configuration
	Client EurekaClientConfig `json:"client"`
}

func NewConfigFromArgs

func NewConfigFromArgs(appName, host string, port int, serviceUrls ...string) *EurekaConfig

func Read

func Read(configFile string) (config EurekaConfig, err error)

func (*EurekaConfig) PopulateDefaults

func (c *EurekaConfig) PopulateDefaults()

type EurekaInstanceConfig

type EurekaInstanceConfig struct {
	AppName            string `json:"app"`
	IpAddress          string `json:"ipAddress"`
	HostName           string `json:"hostName"`
	Port               int    `json:"port"`
	SecurePort         int    `json:"securePort"`
	PreferIpAddress    bool   `json:"preferIpAddress"`
	HomePageUrlPath    string `json:"homePageUrlPath"`
	StatusPageUrlPath  string `json:"statusPageUrlPath"`
	HealthCheckUrlPath string `json:"healthCheckUrlPath"`
}

type FormattedBuffer

type FormattedBuffer struct {
	bytes.Buffer
}

type Instance

type Instance struct {
	InstanceId     string         `json:"instanceId"`
	HostName       string         `json:"hostName"`
	AppName        string         `json:"app"`
	IpAddr         string         `json:"ipAddr"`
	VipAddr        string         `json:"vipAddress"`
	Status         StatusType     `json:"status"`
	Port           Port           `json:"port"`
	SecurePort     Port           `json:"securePort"`
	HomePageUrl    string         `json:"homePageUrl"`
	StatusPageUrl  string         `json:"statusPageUrl"`
	HealthCheckUrl string         `json:"healthCheckUrl"`
	DataCenterInfo DataCenterInfo `json:"dataCenterInfo,omitempty"`
	Metadata       Metadata       `json:"metadata,omitempty"`
}

func NewRegistrationFromInstanceConfig

func NewRegistrationFromInstanceConfig(instance EurekaInstanceConfig) *Instance

func (*Instance) String

func (i *Instance) String() string

func (*Instance) WrapInRequest

func (i *Instance) WrapInRequest() *RegisrationRequest

type LeaseInfo

type LeaseInfo struct {
	RenewalIntervalInSecs int32 `json:"renewalIntervalInSecs"`
	DurationInSecs        int32 `json:"durationInSecs"`
	RegistrationTimestamp int64 `json:"registrationTimestamp"`
	LastRenewalTimestamp  int64 `json:"lastRenewalTimestamp"`
	EvictionTimestamp     int64 `json:"evictionTimestamp"`
	ServiceUpTimestamp    int64 `json:"serviceUpTimestamp"`
}

type Metadata

type Metadata map[string]string

type Port

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

type RegisrationRequest

type RegisrationRequest struct {
	Instance *Instance `json:"instance"`
}

type Registry

type Registry struct {
	XMLName      xml.Name       `json:"applications"`
	VersionDelta int            `json:"versions__delta"`
	Hashcode     string         `json:"apps__hashcode"`
	Apps         []*Application `json:"application"`
}

type StatusType

type StatusType string
const (
	UP           StatusType = "UP"
	DOWN         StatusType = "DOWN"
	STARTING     StatusType = "STARTING"
	OUTOFSERVICE StatusType = "OUT_OF_SERVICE"
	UNKNOWN      StatusType = "UNKNOWN"
)

Supported statuses

Jump to

Keyboard shortcuts

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