temporal

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 38

Documentation

Index

Constants

View Source
const (
	// DefaultContextTimeout default timeout for grpc command invocation
	DefaultContextTimeout = 1 * time.Minute

	// HostTimeout timeout for grpc command relative to host creation
	HostTimeout = 5 * time.Minute

	// LongHostOperationTimeout is a Long timeout
	LongHostOperationTimeout = 10 * time.Minute

	// DefaultSSHConnectionTimeout is the default ssh timeout connection
	DefaultSSHConnectionTimeout = 2 * time.Minute

	// HostCleanupTimeout is the default timeout of host teardown operations
	HostCleanupTimeout = 3 * time.Minute

	// DefaultConnectionTimeout is the default connection timeout
	DefaultConnectionTimeout = 30 * time.Second

	// DefaultExecutionTimeout is the default linux command operation timeout
	DefaultExecutionTimeout = 5 * time.Minute

	// SmallDelay is the predefined small delay
	SmallDelay = 1 * time.Second

	// DefaultDelay is the default delay
	DefaultDelay = 5 * time.Second

	// BigDelay is a big delay
	BigDelay = 30 * time.Second
)

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(dur time.Duration) string

FormatDuration ...

func GetBigDelay

func GetBigDelay() time.Duration

GetBigDelay ...

func GetConnectSSHTimeout

func GetConnectSSHTimeout() time.Duration

GetConnectSSHTimeout ...

func GetConnectionTimeout

func GetConnectionTimeout() time.Duration

GetConnectionTimeout ...

func GetContextTimeout

func GetContextTimeout() time.Duration

GetContextTimeout ...

func GetDefaultDelay

func GetDefaultDelay() time.Duration

GetDefaultDelay ...

func GetExecutionTimeout

func GetExecutionTimeout() time.Duration

GetExecutionTimeout ...

func GetHostCleanupTimeout

func GetHostCleanupTimeout() time.Duration

GetHostCleanupTimeout ...

func GetHostCreationTimeout

func GetHostCreationTimeout() time.Duration

GetHostCreationTimeout ...

func GetHostTimeout

func GetHostTimeout() time.Duration

GetHostTimeout ...

func GetLongOperationTimeout

func GetLongOperationTimeout() time.Duration

GetLongOperationTimeout ...

func GetMinDelay

func GetMinDelay() time.Duration

GetMinDelay ...

func GetTimeoutFromEnv

func GetTimeoutFromEnv(key string, duration time.Duration) time.Duration

GetTimeoutFromEnv reads a environment variable 'string', interprets the variable as a time.Duration if possible and returns the time to the caller if there is a failure, it returns a default duration 'duration' passed as an argument when calling the function

Types

type Stopwatch

type Stopwatch interface {
	// Start starts the stopwatch, either for the first time or after a Pause()
	Start()
	// Stop stops definitively the stopwatch, disabling the ability to start it again
	Stop()
	// Pause stops temporarily the stopwatch, allowing to start it again, suming up the time intervals
	Pause()
	// Duration returns the current elapsed time measured by the Stopwatch
	Duration() time.Duration
	// String returns a printable representation of the current elapsed time
	String() string
	// OnExitLogWithLevel returns a function that will log start and end of Stopwatch, intended tto be used with defer
	OnExitLogWithLevel(in, out string, level logrus.Level) func()
	// OnExitLogInfo
	OnExitLogInfo(in, out string) func()
}

Stopwatch interface to expose methods available for a stopwatch

func NewStopwatch

func NewStopwatch() Stopwatch

NewStopwatch creates a object satisfying interface Stopwatch

Jump to

Keyboard shortcuts

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