registry

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGeeRegistry = NewGeeRegistry(defaultAlive)

Functions

func HandleHTTP

func HandleHTTP()

default HandleHTTP

func HeartBeat

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

Heartbeat send a heartbeat message every once in a while it's a helper function for a server to register or send heartbeat

Types

type GeeRegistry

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

GeeRegistry is a simple register center, provide following functions. add a server and receive heartbeat to keep it alive. returns all alive servers and delete dead servers sync simultaneously.

func NewGeeRegistry

func NewGeeRegistry(timeout time.Duration) *GeeRegistry

func (*GeeRegistry) HandleHTTP

func (r *GeeRegistry) HandleHTTP(registryPath string)

func (*GeeRegistry) ServeHTTP

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

run at /geerpc/registry all info is in httpHead

type ServerItem

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

means a server

Jump to

Keyboard shortcuts

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