delegate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigBasedPool

type ConfigBasedPool struct {
	service.AbstractService
	// contains filtered or unexported fields
}

ConfigBasedPool is the simple delegate pool implementing Pool interface

func NewConfigBasedPool

func NewConfigBasedPool(delegate *config.Delegate) *ConfigBasedPool

NewConfigBasedPool creates an instance of config-based delegate pool

func (*ConfigBasedPool) AllDelegates

func (cbdp *ConfigBasedPool) AllDelegates() ([]net.Addr, error)

AllDelegates implements getting the delegates from config

func (*ConfigBasedPool) AnotherDelegate

func (cbdp *ConfigBasedPool) AnotherDelegate(self string) net.Addr

AnotherDelegate return the first delegate that is not the passed-in address

type Pool

type Pool interface {
	// AllDelegates returns all delegates
	AllDelegates() ([]net.Addr, error)

	// AnotherDelegate return another delegate that is not the passed-in address
	AnotherDelegate(self string) net.Addr
}

Pool is the interface

Jump to

Keyboard shortcuts

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