registry

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AllNodes

func AllNodes() ([]*memberlist.Node, error)

AllNodes return all memberlist nodes except dead and left nodes

func BaseUrl

func BaseUrl(node *memberlist.Node) (string, error)

func CallbackOnChange added in v1.0.6

func CallbackOnChange(listener *memConfigListener) func(event *configmgr.NacosChangeEvent)

func Leave

func Leave(timeout time.Duration)

Leave leaves the cluster on purpose

func LocalNode

func LocalNode() *memberlist.Node

func MetaWeight

func MetaWeight(node *memberlist.Node) (int, error)

func NewNode

func NewNode(data ...map[string]interface{}) error

NewNode creates a new go-doudou node. service related custom data (<= 512 bytes after being marshalled as json format) can be passed into it by data parameter. it is made as a variadic function only for backward compatibility purposes, only first parameter will be used.

func RegisterServiceProvider

func RegisterServiceProvider(sp IMemberlistServiceProvider)

func Shutdown

func Shutdown()

Shutdown stops all connections and communications with other nodes in the cluster

func SvcName

func SvcName(node *memberlist.Node) string

Types

type IMemberlistServiceProvider added in v1.1.1

type IMemberlistServiceProvider interface {
	IServiceProvider
	AddNode(node *memberlist.Node)
	UpdateWeight(node *memberlist.Node)
	RemoveNode(node *memberlist.Node)
}

IMemberlistServiceProvider defines service provider interface for server discovery

type INacosServiceProvider added in v1.1.1

type INacosServiceProvider interface {
	SetClusters(clusters []string)
	SetGroupName(groupName string)
	SetNamingClient(namingClient naming_client.INamingClient)
}

type IServiceProvider

type IServiceProvider interface {
	SelectServer() string
}

type NodeInfo

type NodeInfo struct {
	SvcName   string                 `json:"svcName"`
	Hostname  string                 `json:"hostname"`
	BaseUrl   string                 `json:"baseUrl"`
	Status    string                 `json:"status"`
	Uptime    string                 `json:"uptime"`
	GoVer     string                 `json:"goVer"`
	GddVer    string                 `json:"gddVer"`
	BuildUser string                 `json:"buildUser"`
	BuildTime string                 `json:"buildTime"`
	Data      map[string]interface{} `json:"data"`
	Host      string                 `json:"host"`
	SvcPort   int                    `json:"svcPort"`
	MemPort   int                    `json:"memPort"`
}

NodeInfo wraps node information

func Info

func Info(node *memberlist.Node) NodeInfo

Info return node info

Directories

Path Synopsis
* Copyright 1999-2020 Alibaba Group Holding Ltd.
* Copyright 1999-2020 Alibaba Group Holding Ltd.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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