registry

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRegistry

type IRegistry interface {
	Register() error
	Discover(svc string) ([]*Node, error)
}

type Node

type Node struct {
	// contains filtered or unexported fields
}
var LocalNode *Node

func NewNode

func NewNode(opts ...NodeOption) (*Node, error)

func (*Node) BaseUrl

func (n *Node) BaseUrl() string

func (Node) Discover

func (r Node) Discover(svc string) ([]*Node, error)

func (*Node) Info added in v0.5.8

func (n *Node) Info() NodeInfo

func (*Node) NumNodes

func (n *Node) NumNodes() (numNodes int)

func (Node) Register

func (r Node) Register() error

func (*Node) Shutdown added in v0.6.9

func (n *Node) Shutdown()

func (*Node) String

func (n *Node) String() string

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"`
}

type NodeOption

type NodeOption func(*Node)

func WithData

func WithData(data interface{}) NodeOption

Jump to

Keyboard shortcuts

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