Documentation
¶
Index ¶
- func DropOldInstance(cnf EurekaClientConfig)
- func EurekaDeleteApp(ul, auth, name, id string) error
- func EurekaHeartBeat(ul, auth, name, id string) error
- func EurekaRegist(ul string, auth string, e EurekaAppInstance) error
- func GetAppUrl(cfname string, name string) (string, error)
- func GetInnerIp() string
- func GetMs() int64
- func HttpDelete(ul string, header http.Header, params url.Values, tmout int64) (*http.Response, error)
- func HttpGet(ul string, header http.Header, params url.Values, tmout int64) (*http.Response, error)
- func HttpPost(ul string, header http.Header, data []byte, tmout int64) (*http.Response, error)
- func HttpPut(ul string, header http.Header, data []byte, tmout int64) (*http.Response, error)
- func ShowApps()
- func Start(cnf EurekaClientConfig, debug bool) error
- func StartBatch(cnfs []EurekaClientConfig, debug bool) error
- func StartForKeeper(cnf EurekaClientConfig, debug bool)
- func StartForKeeperBatch(cnfs []EurekaClientConfig, debug bool)
- type AddressObject
- type AppAllResponse
- type AppObject
- func (a *AppObject) AddHost(scheme, host, port, healthUrl string) bool
- func (a *AppObject) GetAddresses() []AddressObject
- func (a *AppObject) GetAllUrls() []string
- func (a *AppObject) GetAnHost() (AddressObject, error)
- func (a *AppObject) GetAnUrl() (string, error)
- func (a *AppObject) HasHost() bool
- func (a *AppObject) RemoveUnhealthAddress(addrs []AddressObject)
- type AppResponse
- type Applications
- type DataCenterInfo
- type EurekaAppCache
- func (e *EurekaAppCache) GetAllUrl(cfname string, name string) (string, error)
- func (e *EurekaAppCache) GetAnHost(cfname string, name string) (AddressObject, error)
- func (e *EurekaAppCache) GetAnUrl(cfname string, name string) (string, error)
- func (e *EurekaAppCache) Save(cfname string, info EurekaAppInfo)
- func (e *EurekaAppCache) ShowApps()
- type EurekaAppInfo
- type EurekaAppInstance
- type EurekaClientConfig
- type EurekaRegisterRequest
- type InstancePort
- type InstanceSecurePort
- type LeaseInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EurekaDeleteApp ¶
EurekaDeleteApp 删除已注册的应用实例
func EurekaRegist ¶
func EurekaRegist(ul string, auth string, e EurekaAppInstance) error
EurekaRegist 注册新的服务
func HttpDelete ¶
func HttpDelete(ul string, header http.Header, params url.Values, tmout int64) (*http.Response, error)
HttpDelete http Delete 请求
func StartForKeeperBatch ¶
func StartForKeeperBatch(cnfs []EurekaClientConfig, debug bool)
批量仅维护应用列表而启动
Types ¶
type AddressObject ¶
AddressObject
func NewAddress ¶
func NewAddress(name, scheme, host, port, healthUrl string) AddressObject
NewAddress
type AppAllResponse ¶
type AppAllResponse struct {
Applications Applications `json:"applications"`
}
AppAllResponse Eureka响应所有应用信息
func EurekaGetAppAll ¶
func EurekaGetAppAll(ul, auth string) (AppAllResponse, error)
EurekaGetAppAll 拉取所有应用
type AppObject ¶
type AppObject struct {
Name string
Hosts []AddressObject
}
AppObject
func (*AppObject) RemoveUnhealthAddress ¶
func (a *AppObject) RemoveUnhealthAddress(addrs []AddressObject)
RemoveUnhealthAddress
type AppResponse ¶
type AppResponse struct {
Application EurekaAppInfo `json:"application"`
}
AppResponse Eureka响应应用信息
type Applications ¶
type Applications struct {
Versions__delta string `json:"versions__delta"`
Apps__hashcode string `json:"apps__hashcode"`
Application []EurekaAppInfo `json:"application"`
}
type DataCenterInfo ¶
DataCenterInfo
type EurekaAppCache ¶
EurekaAppCache
func (*EurekaAppCache) GetAllUrl ¶
func (e *EurekaAppCache) GetAllUrl(cfname string, name string) (string, error)
GetAllUrl
func (*EurekaAppCache) GetAnHost ¶
func (e *EurekaAppCache) GetAnHost(cfname string, name string) (AddressObject, error)
GetAnHost
type EurekaAppInfo ¶
type EurekaAppInfo struct {
Name string `json:"name"`
Instance []EurekaAppInstance `json:"instance"`
}
EurekaAppInfo 应用信息
type EurekaAppInstance ¶
type EurekaAppInstance struct {
InstanceId string `json:"instanceId"`
App string `json:"app"`
AppGroupName string `json:"appGroupName"`
IpAddr string `json:"ipAddr"`
Sid string `json:"sid"`
Port InstancePort `json:"port"`
SecurePort InstanceSecurePort `json:"securePort"`
HealthCheckUrl string `json:"healthCheckUrl"`
StatusPageUrl string `json:"statusPageUrl"`
HomePageUrl string `json:"homePageUrl"`
VipAddress string `json:"vipAddress"`
SecureVipAddress string `json:"secureVipAddress"`
CountryId int `json:"countryId"`
DataCenterInfo DataCenterInfo `json:"dataCenterInfo"`
HostName string `json:"hostName"`
Status string `json:"status"`
Overriddenstatus string `json:"overriddenstatus"`
LeaseInfo LeaseInfo `json:"leaseInfo"`
IsCoordinatingDiscoveryServer string `json:"isCoordinatingDiscoveryServer"`
Metadata map[string]interface{} `json:"metadata"`
LastUpdatedTimestamp string `json:"lastUpdatedTimestamp"`
LastDirtyTimestamp string `json:"lastDirtyTimestamp"`
ActionType string `json:"actionType"`
}
EurekaAppInstance Eureka应用实例信息
func NewEurekaAppInstance ¶
func NewEurekaAppInstance(cnf EurekaClientConfig) EurekaAppInstance
NewEurekaAppInstance 实例化一个Eureka实例
type EurekaClientConfig ¶
type EurekaClientConfig struct {
EurekaName string // Eureka名称,用于区分多个eureka服务端,应全局唯一
EurekaServerAddress string // Eureka服务端接口地址
Authorization string // Http Auth授权信息
Apps []string // 需要的服务名列表
AppName string // 本服务名称
InstanceDomain string // 本服务的域名地址 | 置空
InstanceIp string // 本服务的ip地址 | 置空
InstancePort int // 本服务的开放端口
InstanceHomePageUrl string // 本服务的主页地址
InstanceStatusUrl string // 本服务的状态检查地址
InstanceHealthCheckUrl string // 本服务的健康检查地址
RenewalIntervalInSecs int64 // 本服务的心跳周期 单位秒
DurationInSecs int64 // 本服务的心跳失约后,注册信息保留时长,超时删除注册信息 单位秒
AppRefreshSecs int64 // 需要的应用列表里的应用服务信息刷新间隔 单位秒
DropOldInstanceWhenStart bool // 是否在启动时注册前删除该应用旧的注册信息
}
EurekaClientConfig Eureka客户端配置项
func NewEurekaConf ¶
func NewEurekaConf(name string) EurekaClientConfig
NewEurekaConf 实例化一个eureka客户端配置
func (*EurekaClientConfig) HostName ¶
func (e *EurekaClientConfig) HostName() string
HostName 获取主机名称
func (*EurekaClientConfig) RefreshLocalIp ¶
func (e *EurekaClientConfig) RefreshLocalIp()
RefreshLocalIp 刷新本地IP信息
type EurekaRegisterRequest ¶
type EurekaRegisterRequest struct {
Instance EurekaAppInstance `json:"instance"`
}
EurekaRegisterRequest Eureka注册请求结构
type InstancePort ¶
InstancePort 实例端口
type InstanceSecurePort ¶
InstanceSecurePort 实例安全端口
type LeaseInfo ¶
type LeaseInfo struct {
RenewalIntervalInSecs int64 `json:"renewalIntervalInSecs"`
DurationInSecs int64 `json:"durationInSecs"`
RegistrationTimestamp int64 `json:"registrationTimestamp"`
LastRenewalTimestamp int64 `json:"lastRenewalTimestamp"`
RenewalTimestamp int64 `json:"renewalTimestamp"`
EvictionTimestamp int64 `json:"evictionTimestamp"`
ServiceUpTimestamp int64 `json:"serviceUpTimestamp"`
}
LeaseInfo
Click to show internal directories.
Click to hide internal directories.