modeutil

package
v5.6.16 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoConnectionConfigured indicates no configured connections for publishing.
	ErrNoConnectionConfigured = errors.New("No connection configured")
)

Functions

func MakeAsyncClients

func MakeAsyncClients(
	config *common.Config,
	newClient AsyncClientFactory,
) ([]mode.AsyncProtocolClient, error)

func MakeClients

func MakeClients(
	config *common.Config,
	newClient ClientFactory,
) ([]mode.ProtocolClient, error)

MakeClients will create a list from of ProtocolClient instances from outputer configuration host list and client factory function.

func NewAsyncConnectionMode

func NewAsyncConnectionMode(
	clients []mode.AsyncProtocolClient,
	s Settings,
) (mode.ConnectionMode, error)

func NewAsyncFailoverClient

func NewAsyncFailoverClient(clients []mode.AsyncProtocolClient) []mode.AsyncProtocolClient

func NewConnectionMode

func NewConnectionMode(
	clients []mode.ProtocolClient,
	s Settings,
) (mode.ConnectionMode, error)

func NewFailoverClient

func NewFailoverClient(clients []mode.ProtocolClient) []mode.ProtocolClient

func ReadHostList

func ReadHostList(cfg *common.Config) ([]string, error)

Types

type AsyncClientFactory

type AsyncClientFactory func(string) (mode.AsyncProtocolClient, error)

type ClientFactory

type ClientFactory func(host string) (mode.ProtocolClient, error)

type Settings

type Settings struct {
	Failover     bool
	MaxAttempts  int
	WaitRetry    time.Duration
	Timeout      time.Duration
	MaxWaitRetry time.Duration
}

Jump to

Keyboard shortcuts

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