grpcsrvlb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoRetryLimit specifies that there is no limit to number of srv lookup failures.
	NoRetryLimit = -1
)

Variables

View Source
var (
	// MinimumRefreshInterval decides the maximum sleep time between SRV Lookups, otherwise controlled by TTL of records.
	MinimumRefreshInterval = 5 * time.Second
)

Functions

func New

func New(srvResolver srv.Resolver, options ...SrvResolverOptions) naming.Resolver

New creates a gRPC naming.Resolver that is backed by an SRV lookup resolver.

Types

type SrvResolverOptions

type SrvResolverOptions func(*resolver)

func WithMaximumConsecutiveErrors

func WithMaximumConsecutiveErrors(maxErr int) SrvResolverOptions

MaximumConsecutiveErrors identifies how many consecutive iterations of bad SRV Lookups to tolerate in a loop. After this limit is reached all the srv resolutions will stop. Default value is -1. -1 means there is no limit.

func WithRetryBackoff

func WithRetryBackoff(retryBackoff *backoff.Backoff) SrvResolverOptions

WithRetryBackoff sets or clears the backoff when retrying after lookup failures. By default, an exponential backoff with a maximum of MinimumRefreshInterval is used. Pass nil to clear backoff, causing instant retries.

Jump to

Keyboard shortcuts

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