ftime

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ftime defines "fleetspeak time" as a global variable. This is the sense of time used by the fleetspeak server and it can be changed to support unit testing.

Index

Constants

This section is empty.

Variables

View Source
var ClientRetryTime = func() time.Time {
	return Now().Add(15 * time.Minute)
}

ClientRetryTime determines how long to wait for an acknowledgement before sending a message to a client again. The normal implementation waits 15 minutes. It is mutable primarily to support testing.

View Source
var Now = time.Now

Now is the time used by the Fleetspeak system. Variable to support unit testing.

View Source
var ServerRetryTime = func(retryCount uint32) time.Time {
	delay := float64(time.Minute) * math.Pow(1.1, float64(retryCount))
	delay *= 1.0 + rand.Float64()

	return Now().Add(time.Duration(delay))
}

ServerRetryTime determines how long to wait before attempting to process a message again on the FS server. The normal implementation provides exponential backoff with jitter, with an initial wait of 1-2 min. It is mutable primarily to support testing.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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