Documentation
¶
Index ¶
- func BigDelay() time.Duration
- func CommunicationTimeout() time.Duration
- func ConnectionTimeout() time.Duration
- func ContextTimeout() time.Duration
- func DefaultDelay() time.Duration
- func ExecutionTimeout() time.Duration
- func FormatDuration(dur time.Duration) string
- func HostBootTimeout() time.Duration
- func HostCleanupTimeout() time.Duration
- func HostCreationTimeout() time.Duration
- func HostLongOperationTimeout() time.Duration
- func HostOperationTimeout() time.Duration
- func MaxTimeout(a time.Duration, b time.Duration) time.Duration
- func MetadataReadAfterWriteTimeout() time.Duration
- func MetadataTimeout() time.Duration
- func MinDelay() time.Duration
- func NormalDelay() time.Duration
- func OperationTimeout() time.Duration
- func RebootTimeout() time.Duration
- func SSHConnectionTimeout() time.Duration
- func SmallDelay() time.Duration
- type Delays
- type MutableTimings
- func (t *MutableTimings) BigDelay() time.Duration
- func (t *MutableTimings) CommunicationTimeout() time.Duration
- func (t *MutableTimings) ConnectionTimeout() time.Duration
- func (t *MutableTimings) ContextTimeout() time.Duration
- func (t *MutableTimings) ExecutionTimeout() time.Duration
- func (t *MutableTimings) HostBootTimeout() time.Duration
- func (t *MutableTimings) HostCleanupTimeout() time.Duration
- func (t *MutableTimings) HostCreationTimeout() time.Duration
- func (t *MutableTimings) HostLongOperationTimeout() time.Duration
- func (t *MutableTimings) HostOperationTimeout() time.Duration
- func (t *MutableTimings) MetadataReadAfterWriteTimeout() time.Duration
- func (t *MutableTimings) MetadataTimeout() time.Duration
- func (t *MutableTimings) NormalDelay() time.Duration
- func (t *MutableTimings) OperationTimeout() time.Duration
- func (t *MutableTimings) RebootTimeout() time.Duration
- func (t *MutableTimings) SSHConnectionTimeout() time.Duration
- func (t *MutableTimings) SmallDelay() time.Duration
- func (t *MutableTimings) Update(a *MutableTimings) error
- type Stopwatch
- type Timeouts
- type Timings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostLongOperationTimeout ¶
HostLongOperationTimeout ...
func MaxTimeout ¶
MaxTimeout return the maximum of timeouts 'a' and 'b'
func MetadataReadAfterWriteTimeout ¶
MetadataReadAfterWriteTimeout ...
func NormalDelay ¶
NormalDelay returns the duration for a normal delay
func RebootTimeout ¶
Types ¶
type MutableTimings ¶
type MutableTimings struct {
Timeouts `json:"timeouts" mapstructure:"timeouts"`
Delays `json:"delays" mapstructure:"delays"`
}
func NewTimings ¶
func NewTimings() *MutableTimings
NewTimings creates a new instance of MutableTimings with default values
func (*MutableTimings) BigDelay ¶
func (t *MutableTimings) BigDelay() time.Duration
BigDelay returns the duration of a big delay
func (*MutableTimings) CommunicationTimeout ¶
func (t *MutableTimings) CommunicationTimeout() time.Duration
CommunicationTimeout returns the configured timeout for communication (optionally overloaded from ENV)
func (*MutableTimings) ConnectionTimeout ¶
func (t *MutableTimings) ConnectionTimeout() time.Duration
ConnectionTimeout returns the configured timeout for connection
func (*MutableTimings) ContextTimeout ¶
func (t *MutableTimings) ContextTimeout() time.Duration
ContextTimeout returns the configured timeout for context (optionally overloaded from ENV)
func (*MutableTimings) ExecutionTimeout ¶
func (t *MutableTimings) ExecutionTimeout() time.Duration
ExecutionTimeout returns the configured timeout for execution
func (*MutableTimings) HostBootTimeout ¶
func (t *MutableTimings) HostBootTimeout() time.Duration
HostBootTimeout ...
func (*MutableTimings) HostCleanupTimeout ¶
func (t *MutableTimings) HostCleanupTimeout() time.Duration
HostCleanupTimeout returns the configured timeout for host cleanup
func (*MutableTimings) HostCreationTimeout ¶
func (t *MutableTimings) HostCreationTimeout() time.Duration
HostCreationTimeout returns the configured timeout for host creation (optionally overloaded from ENV)
func (*MutableTimings) HostLongOperationTimeout ¶
func (t *MutableTimings) HostLongOperationTimeout() time.Duration
HostLongOperationTimeout returns the configured timeout for long Host operation (optionally overloaded from ENV)
func (*MutableTimings) HostOperationTimeout ¶
func (t *MutableTimings) HostOperationTimeout() time.Duration
HostOperationTimeout returns the configured timeout for host operation (other than creation or cleanup)
func (*MutableTimings) MetadataReadAfterWriteTimeout ¶
func (t *MutableTimings) MetadataReadAfterWriteTimeout() time.Duration
MetadataReadAfterWriteTimeout returns the configured timeout for metadata read after write
func (*MutableTimings) MetadataTimeout ¶
func (t *MutableTimings) MetadataTimeout() time.Duration
MetadataTimeout returns the configured timeout for metadata access
func (*MutableTimings) NormalDelay ¶
func (t *MutableTimings) NormalDelay() time.Duration
NormalDelay returns the duration of a normal delay
func (*MutableTimings) OperationTimeout ¶
func (t *MutableTimings) OperationTimeout() time.Duration
OperationTimeout returns the configured timeout for operation (optionally overloaded from ENV)
func (*MutableTimings) RebootTimeout ¶
func (t *MutableTimings) RebootTimeout() time.Duration
RebootTimeout returns the time we wait after a reboot before trying SSH connection
func (*MutableTimings) SSHConnectionTimeout ¶
func (t *MutableTimings) SSHConnectionTimeout() time.Duration
SSHConnectionTimeout returns the configured timeout for SSH connection
func (*MutableTimings) SmallDelay ¶
func (t *MutableTimings) SmallDelay() time.Duration
SmallDelay returns the duration of a small delay
func (*MutableTimings) Update ¶
func (t *MutableTimings) Update(a *MutableTimings) error
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()
// GetDuration returns the current elapsed time measured by the Stopwatch
GetDuration() 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(ctx context.Context, in, out string, level logrus.Level) func()
OnExitLogInfo(ctx context.Context, 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
type Timeouts ¶
type Timeouts struct {
Communication time.Duration `json:"timeout_communication,omitempty" mapstructure:"communication"`
Connection time.Duration `json:"timeout_connection,omitempty" mapstructure:"connection"`
Context time.Duration `json:"timeout_context,omitempty" mapstructure:"context"`
HostCreation time.Duration `json:"timeout_host_creation,omitempty" mapstructure:"hostcreation"`
HostBoot time.Duration `json:"timeout_host_boot,omitempty" mapstructure:"hostboot"`
HostCleanup time.Duration `json:"timeout_host_cleanup,omitempty" mapstructure:"hostcleanup"`
HostOperation time.Duration `json:"timeout_host_operation,omitempty" mapstructure:"hostoperation"`
HostLongOperation time.Duration `json:"timeout_host_long_operation,omitempty" mapstructure:"hostlongoperation"`
Operation time.Duration `json:"timeout_operation,omitempty" mapstructure:"operation"`
SSHConnection time.Duration `json:"timeout_ssh_connection,omitempty" mapstructure:"sshconnection"`
Metadata time.Duration `json:"timeout_metadata,omitempty" mapstructure:"metadata"`
MetadataReadAfterWrite time.Duration `json:"timeout_metadata_raw,omitempty" mapstructure:"metadatareadafterwrite"`
RebootTimeout time.Duration `json:"timeout_reboot,omitempty" mapstructure:"reboot"`
}
type Timings ¶
type Timings interface {
// OperationTimeout ...
OperationTimeout() time.Duration
// HostOperationTimeout ...
HostOperationTimeout() time.Duration
// HostLongOperationTimeout ...
HostLongOperationTimeout() time.Duration
// HostCreationTimeout ...
HostCreationTimeout() time.Duration
// HostBootTimeout ...
HostBootTimeout() time.Duration
// HostCleanupTimeout ...
HostCleanupTimeout() time.Duration
// CommunicationTimeout ...
CommunicationTimeout() time.Duration
// ConnectionTimeout ...
ConnectionTimeout() time.Duration
// ContextTimeout ...
ContextTimeout() time.Duration
// ExecutionTimeout ...
ExecutionTimeout() time.Duration
// SSHConnectionTimeout ...
SSHConnectionTimeout() time.Duration
// MetadataTimeout ...
MetadataTimeout() time.Duration
// RebootTimeout ...
RebootTimeout() time.Duration
// MetadataReadAfterWriteTimeout ...
MetadataReadAfterWriteTimeout() time.Duration
// SmallDelay ...
SmallDelay() time.Duration
// NormalDelay returns the currently configure normal delay stored in Timings
NormalDelay() time.Duration
// BigDelay returns the currently configured big delay stored in Timings
BigDelay() time.Duration
}