registry

package
v0.0.0-...-1b68696 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDrpcRegister = New(defaultTimeOut)

Functions

func HandleHTTP

func HandleHTTP()

func Heartbeat

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

Heartbeat 提供 HeartBeat 方法,便于服务启动时定时向注册中心发送心跳,默认周期比注册中心设置过期的时间少1min

Types

type DrpcRegistry

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

func New

func New(timeout time.Duration) *DrpcRegistry

func (*DrpcRegistry) HandleHTTP

func (r *DrpcRegistry) HandleHTTP(registryPath string)

HandleHTTP registers a HTTP handler for DrpcRegistry messages on registryPath

func (*DrpcRegistry) ServeHTTP

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

run at /_drpc_/registry

type ServerItem

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

Jump to

Keyboard shortcuts

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