package
0.0.0-20220412220916-5ea02083e3ec
Repository: https://github.com/riteshrch/go-edge-device-lib.git
Documentation: pkg.go.dev

# Functions

Advertise is a utility function that persistently advertises a service through an Advertiser.
FindPeers is a utility function that synchronously collects peers from a Discoverer.
FullJitter returns a random number uniformly chose from the range [min, boundedDur].
NewBackoffConnector creates a utility to connect to peers, but only if we have not recently tried connecting to them already cacheSize is the size of a TwoQueueCache connectionTryDuration is how long we attempt to connect to a peer before giving up backoff describes the strategy used to decide how long to backoff after previously attempting to connect to a peer.
No description provided by the author
No description provided by the author
NewExponentialBackoff creates a BackoffFactory with backoff of the form base^x + offset where x is the attempt number jitter is the function for adding randomness around the backoff timeUnits are the units of time the base^x is evaluated in.
NewExponentialDecorrelatedJitter creates a BackoffFactory with backoff of the roughly of the form base^x where x is the attempt number.
NewFixedBackoff creates a BackoffFactory with a constant backoff duration.
NewPolynomialBackoff creates a BackoffFactory with backoff of the form c0*x^0, c1*x^1, ...cn*x^n where x is the attempt number jitter is the function for adding randomness around the backoff timeUnits are the units of time the polynomial is evaluated in polyCoefs is the array of polynomial coefficients from [c0, c1, ..
No description provided by the author
NoJitter returns the duration bounded between min and max.
WithBackoffDiscoveryReturnedChannelSize sets the size of the buffer to be used during a FindPeer query.
WithBackoffDiscoverySimultaneousQueryBufferSize sets the buffer size for the channels between the main FindPeers query for a given namespace and all simultaneous FindPeers queries for the namespace.

# Structs

BackoffConnector is a utility to connect to peers, but only if we have not recently tried connecting to them already.
BackoffDiscovery is an implementation of discovery that caches peer data and attenuates repeated queries.
No description provided by the author
RoutingDiscovery is an implementation of discovery using ContentRouting.

# Interfaces

BackoffStrategy describes how backoff will be implemented.

# Type aliases

No description provided by the author
No description provided by the author
Jitter must return a duration between min and max.