Back to godoc.org

Package peerlistmgr

v1.15.1
Latest Go to latest

The highest tagged major version is .

Published: Nov 7, 2019 | License: Apache-2.0 | Module: github.com/Hoggles/TraceAI

Index

Variables

var Options = options{}

Options is a factory for different options.

type Option

type Option func(*options)

Option is a function that sets some option.

type PeerListManager

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

PeerListManager uses a discovery.Notifier to manage tchannel.PeerList by making sure that there are connections to at least minPeers.

func New

func New(
	peerList *tchannel.PeerList,
	discoverer discovery.Discoverer,
	notifier discovery.Notifier,
	opts ...Option,
) (*PeerListManager, error)

New creates new PeerListManager.

func (PeerListManager) ConnCheckFrequency

func (o PeerListManager) ConnCheckFrequency(connCheckFrequency time.Duration) Option

ConnCheckFrequency changes how frequently manager will check for MinPeers connections.

func (PeerListManager) ConnCheckTimeout

func (o PeerListManager) ConnCheckTimeout(connCheckTimeout time.Duration) Option

ConnCheckTimeout changes the timeout used when establishing new connections.

func (PeerListManager) Logger

func (o PeerListManager) Logger(logger *zap.Logger) Option

Logger creates an Option that assigns the logger.

func (PeerListManager) MinPeers

func (o PeerListManager) MinPeers(minPeers int) Option

MinPeers changes min number of open connections to peers that the manager will try to maintain.

func (*PeerListManager) Stop

func (m *PeerListManager) Stop()

Stop shuts down the manager. It blocks until both bg go-routines exit.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier