kanata_discovery

package
v0.0.0-...-63f7e71 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionExpired           = errors.New("session expired")
	ErrIllegalPathNodeCharacter = errors.New("illegal path node character")
	ErrPathNodeEmpty            = errors.New("path node empty")
	ErrNoServiceFound           = errors.New("no service found")
)

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	Start() error
	GracefulShutdown() error

	AcquireSession() (int64, error)
	SessionHeatbeat(session int64) error

	PublishService(node *Node, service, version string, tags []string, session int64) error
	PickOneFromTag(service, version, tag string) (*Node, error)
	PickAllFromTag(service, version, tag string) ([]*Node, error)
}

func NewDiscovery

func NewDiscovery(endpoints []string, namespace string) (Discovery, error)

type Node

type Node struct {
	Weight int `json:"weight"` // 1-65535, 0 default

	Address []byte `json:"address"`
	Port    uint16 `json:"port"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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