registry

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 11 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
}

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) NumNodes

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

func (Node) Register

func (r Node) Register() error

func (*Node) String

func (n *Node) String() string

type NodeOption

type NodeOption func(*Node)

func WithData

func WithData(data interface{}) NodeOption

type NodeState

type NodeState int
const (
	Alive NodeState = iota
	Leaving
	Left
	Shutdown
)

func (NodeState) String

func (s NodeState) String() string

Jump to

Keyboard shortcuts

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