sd

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(cfg *config.Common, sd SD, checkOnly bool) error

func Register

func Register(cfg *config.Common, logger *zap.Logger)

func Stop

func Stop()

Types

type SD

type SD interface {
	// Update update node record
	Update(listenIP, listenPort string, dc []string, weight int64) error
	// Delete delete node record (with ip/port/dcs)
	Delete(ip, port string, dcs []string) error
	// Delete delete node record
	DeleteNode(node string) (err error)
	// Clear clear node record (all except with current listen IP/port)
	Clear(listenIP, listenPort string) error
	// Nodes return all registered nodes (for all hostnames in namespace)
	Nodes() (nodes []utils.KV, err error)
	// List return all registered nodes for hostname
	List() (nodes []string, err error)
	// Namespace return namespace
	Namespace() string
}

func New

func New(cfg *config.Common, hostname string, logger *zap.Logger) (SD, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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