Internal call graph ▹
Internal call graph ▾
In the call graph viewer below, each node is a function belonging to this package and its children are the functions it calls—perhaps dynamically.
The root nodes are the entry points of the package: functions that may be called from outside the package. There may be non-exported or anonymous functions among them if they are called dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring
Functions may be omitted if they were determined to be unreachable in the particular programs or tests that were analyzed.
var ( // SeededSecurely is set to true if a cryptographically secure seed // was used to initialize rand. When false, the start time is used // as a seed. SeededSecurely bool )
func AbsInt(a int) int
func ComputeDistance ¶
func ComputeDistance(a *coordinate.Coordinate, b *coordinate.Coordinate) float64
ComputeDistance returns the distance between the two network coordinates in seconds. If either of the coordinates is nil then this will return positive infinity.
func DurationMinusBuffer ¶
func DurationMinusBuffer(intv time.Duration, buffer time.Duration, jitter int64) time.Duration
DurationMinusBuffer returns a duration, minus a buffer and jitter subtracted from the duration. This function is used primarily for servicing Consul TTL Checks in advance of the TTL.
func DurationMinusBufferDomain(intv time.Duration, buffer time.Duration, jitter int64) (min time.Duration, max time.Duration)
DurationMinusBufferDomain returns the domain of valid durations from a call to DurationMinusBuffer. This function is used to check user specified input values to DurationMinusBuffer.
func EnsurePath ¶
func EnsurePath(path string, dir bool) error
EnsurePath is used to make sure a path exists
func GenerateCoordinate ¶
func GenerateCoordinate(rtt time.Duration) *coordinate.Coordinate
GenerateCoordinate creates a new coordinate with the given distance from the origin. This should only be used for tests.
func MaxInt(a, b int) int
func MinInt(a, b int) int
func RandomStagger ¶
func RandomStagger(intv time.Duration) time.Duration
RandomStagger returns an interval between 0 and the duration
func RateScaledInterval ¶
func RateScaledInterval(rate float64, min time.Duration, n int) time.Duration
RateScaledInterval is used to choose an interval to perform an action in order to target an aggregate number of actions per second across the whole cluster.
func SeedMathRand ¶
SeedMathRand provides weak, but guaranteed seeding, which is better than running with Go's default seed of 1. A call to SeedMathRand() is expected to be called via init(), but never a second time.
func StrContains ¶
func StrContains(l string, s string) bool
StrContains checks if a list contains a string