discovery

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package discovery defined balancer we use interface ...

Index

Constants

View Source
const (
	LOCALTYPE = iota
)

balancer type

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	Start(namespace string) error
	Up(addr string) (down func(error))
	Get() (addr string, err error)
	GetHostPort() (host string, port int, err error)
	Vote(addr string, voteType int) error
	Notify() <-chan []string
	Close() error
}

Balancer represents load balancing for downstream

func New

func New(sec config.Sectioner) (Balancer, error)

New generate a local_type balancer object by Sectioner

func NewBalancer

func NewBalancer(blancerType int, ns string, hosts []string) (Balancer, error)

NewBalancer generate a balancer object by type

func NewWithHosts

func NewWithHosts(hosts []string) Balancer

NewWithHosts generate a local_type balancer object by hosts

Jump to

Keyboard shortcuts

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