Documentation
¶
Index ¶
- type CheckResponse
- type Config
- type Discovery
- type HttpRouter
- type KV
- type Option
- func WithCheckAddr(addr string) Option
- func WithCheckHTTP(router HttpRouter, checkHttp ...string) Option
- func WithCheckPort(port int) Option
- func WithDeregisterTime(deregisterTime int) Option
- func WithEnableHealthyStatus() Option
- func WithId(id string) Option
- func WithIntervalTime(intervalTime int) Option
- func WithName(name string) Option
- func WithRegisterAddr(addr string) Option
- func WithRegisterPort(port int) Option
- func WithTags(tags ...string) Option
- func WithTimeOut(timeOut int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResponse ¶ added in v0.2.1
func (*CheckResponse) GetOnTime ¶ added in v0.2.1
func (r *CheckResponse) GetOnTime() int64
func (*CheckResponse) Result ¶ added in v0.2.1
func (r *CheckResponse) Result() string
func (*CheckResponse) SetHealthy ¶ added in v0.2.1
func (r *CheckResponse) SetHealthy(healthy string)
type Config ¶
type Config struct {
Id string
Name string
RegisterAddr string
RegisterPort int
CheckAddr string
CheckPort int
Tags []string
IntervalTime int // 健康检查间隔
DeregisterTime int //check失败后30秒删除本服务,注销时间,相当于过期时间
TimeOut int
CheckHTTP string
HttpRouter HttpRouter
CheckHealthyStatus bool
CheckResponse *CheckResponse
}
type HttpRouter ¶ added in v0.2.1
type HttpRouter func(r *CheckResponse)
type Option ¶
type Option func(*Config)
Option for queue system
func WithCheckAddr ¶ added in v0.2.1
WithCheckAddr set addr function
func WithCheckHTTP ¶
func WithCheckHTTP(router HttpRouter, checkHttp ...string) Option
WithCheckHTTP set checkHttp function r.GET(url, func(c *gin.Context) { c.String(200, "Healthy") })
func WithCheckPort ¶ added in v0.2.1
WithCheckPort set port function
func WithDeregisterTime ¶
WithDeregisterTime set deregisterTime function
func WithEnableHealthyStatus ¶ added in v0.2.1
func WithEnableHealthyStatus() Option
WithEnableHealthyStatus checkHealthyStatus function
func WithIntervalTime ¶
WithIntervalTime set intervalTime function
func WithRegisterAddr ¶ added in v0.2.1
WithRegisterAddr set addr function
func WithRegisterPort ¶ added in v0.2.1
WithRegisterPort set port function
Click to show internal directories.
Click to hide internal directories.