service

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

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

Group

func (*Group) Add

func (group *Group) Add(node Node)

Add add node

func (*Group) Count

func (group *Group) Count() int

Count return node count

func (*Group) First

func (group *Group) First() Node

First return fist node

func (*Group) Next

func (group *Group) Next() Node

Next return the next node

func (*Group) Rand

func (group *Group) Rand() Node

Rand return a rand node

type Node

type Node struct {
	// 服务ID
	ID string
	// 服务名称
	Name string
	// 服务地址
	Address string
	// 服务端口
	Port int
	// 服务标签
	Tags []string
}

Node 节点

func (Node) GetHost

func (Node Node) GetHost() string

GetHost 获取服务完整的地址

Jump to

Keyboard shortcuts

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