clb

package
v0.0.0-...-acdf8ed Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBalancerClosed = errors.New("Balancer closed")
View Source
var ErrClientConnClosing = errors.New("Client connection closing")
View Source
var ErrNoAddressAvailable = errors.New("No address available")

Functions

This section is empty.

Types

type Address

type Address struct {
	// Addr is the server address on which a connection will be established.
	Addr string
	// Metadata is the information associated with Addr, which may be used
	// to make load balancing decision.
	Metadata interface{}
}

Address represents a server the client connects to. This is the EXPERIMENTAL API and may be changed or extended in the future.

type Balancer

type Balancer interface {
	Start(target string) error
	Get() (addr Address, err error)
	Close() error
}

func HttpRoundRobin

func HttpRoundRobin(r naming.Resolver) Balancer

type Clb

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

func NewClb

func NewClb(cs *kubernetes.Clientset, cfg Config) *Clb

func (*Clb) ClientConn

func (clb *Clb) ClientConn(target string) *grpc.ClientConn

func (*Clb) Resolve

func (clb *Clb) Resolve(target string) (naming.Watcher, error)

type Config

type Config struct {
	Namespace  string
	HostPrefix string
	Services   map[string]Service
}

func (Config) Get

func (cfg Config) Get(name string) string

type Service

type Service struct {
	Host string
	Port string
}

Jump to

Keyboard shortcuts

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