Documentation ¶
Index ¶
- Variables
- func AllNodes() ([]*memberlist.Node, error)
- func BaseUrl(node *memberlist.Node) (string, error)
- func LocalNode() *memberlist.Node
- func MetaWeight(node *memberlist.Node) (int, error)
- func NewNode(data ...interface{}) error
- func RegisterServiceProvider(sp IServiceProvider)
- func Shutdown()
- func SvcName(node *memberlist.Node) string
- type IServiceProvider
- type NodeInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var BroadcastQueue *memberlist.TransmitLimitedQueue
Functions ¶
func AllNodes ¶ added in v0.8.0
func AllNodes() ([]*memberlist.Node, error)
AllNodes return all memberlist nodes except dead and left nodes
func LocalNode ¶ added in v0.5.8
func LocalNode() *memberlist.Node
func MetaWeight ¶ added in v0.8.0
func MetaWeight(node *memberlist.Node) (int, error)
func RegisterServiceProvider ¶ added in v0.8.0
func RegisterServiceProvider(sp IServiceProvider)
func Shutdown ¶
func Shutdown()
Shutdown stops all connections and communications with other nodes in the cluster
func SvcName ¶ added in v0.8.0
func SvcName(node *memberlist.Node) string
Types ¶
type IServiceProvider ¶ added in v0.8.0
type IServiceProvider interface { SelectServer() string AddNode(node *memberlist.Node) UpdateWeight(node *memberlist.Node) RemoveNode(node *memberlist.Node) }
IServiceProvider defines service provider interface for server discovery
type NodeInfo ¶ added in v0.5.8
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 string `json:"data"` }
NodeInfo wraps node information
Click to show internal directories.
Click to hide internal directories.