balancer

package
v0.0.0-...-6146efe Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNS

type DNS interface {
	FindService(serviceName string) (*ServiceLocation, error)
	GetHttpUrl(serviceName string, useTLS bool) (url.URL, error)
}

DNS balancer finds services through dns and balances load across them

func NewMapBalancer

func NewMapBalancer(services map[string]string) DNS

NewMapBalancer will return the URL from the configured map name -> URL:port

func NewMockDNSBalancer

func NewMockDNSBalancer(services map[string]*ServiceLocation) DNS

type ServiceLocation

type ServiceLocation struct {
	URL  string
	Port int
}

ServiceLocation is a represensation of where a service lives

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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