hosts

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GwHosts

func GwHosts() *types.GwHosts

GwHosts returns the gateway ip list.

func HostsNamespace

func HostsNamespace() string

HostsNamespace returns the gateway hosts prefix of ETCD key.

func SetHostsNamespace

func SetHostsNamespace(prefix string)

SetHostsNamespace sets the gateway hosts prefix of ETCD key.

func SocketAddress

func SocketAddress() (outer, inner string)

SocketAddress returns the current gateway addresses.

func Start

func Start(httpAddr, outerSocketAddr, innerSocketAddr string) error

Start initializes and starts the hosts program.

Types

type Hosts

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

Hosts gateway ip:port list

type SortWeightIps

type SortWeightIps []*WeightIp

SortWeightIps IP weight information list for sorting

func (SortWeightIps) Len

func (s SortWeightIps) Len() int

Len is the number of elements in the collection.

func (SortWeightIps) Less

func (s SortWeightIps) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (SortWeightIps) Swap

func (s SortWeightIps) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type WeightIp

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

WeightIp IP information with weight

Jump to

Keyboard shortcuts

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