registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHeartbeat

func SendHeartbeat(registry, addr string, duration time.Duration)

SendHeartbeat 每隔一段时间发送心跳 发送心跳的间隔时间应该小于注册中心将服务移除的时间

Types

type ServerItem

type ServerItem struct {
	Addr string
	// contains filtered or unexported fields
}

type XzRegistry

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

func NewRegistry

func NewRegistry(timeout time.Duration) *XzRegistry

func (*XzRegistry) HandleHTTP

func (r *XzRegistry) HandleHTTP(registryPath string)

func (*XzRegistry) ServeHTTP

func (r *XzRegistry) ServeHTTP(w http.ResponseWriter, req *http.Request)

简单实现 GET:返回可用的服务列表 POST:添加服务实例或者发送心跳

Jump to

Keyboard shortcuts

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