temporal

package
v22.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigDelay

func BigDelay() time.Duration

BigDelay returns the duration for a big delay

func CommunicationTimeout

func CommunicationTimeout() time.Duration

CommunicationTimeout ...

func ConnectionTimeout

func ConnectionTimeout() time.Duration

ConnectionTimeout ...

func ContextTimeout

func ContextTimeout() time.Duration

ContextTimeout ...

func DefaultDelay

func DefaultDelay() time.Duration

DefaultDelay is a synonym for NormalDelay

func ExecutionTimeout

func ExecutionTimeout() time.Duration

ExecutionTimeout ...

func FormatDuration

func FormatDuration(dur time.Duration) string

FormatDuration ...

func HostBootTimeout

func HostBootTimeout() time.Duration

HostBootTimeout ...

func HostCleanupTimeout

func HostCleanupTimeout() time.Duration

HostCleanupTimeout ...

func HostCreationTimeout

func HostCreationTimeout() time.Duration

HostCreationTimeout ...

func HostLongOperationTimeout

func HostLongOperationTimeout() time.Duration

HostLongOperationTimeout ...

func HostOperationTimeout

func HostOperationTimeout() time.Duration

HostOperationTimeout ...

func MaxTimeout

func MaxTimeout(a time.Duration, b time.Duration) time.Duration

MaxTimeout return the maximum of timeouts 'a' and 'b'

func MetadataReadAfterWriteTimeout

func MetadataReadAfterWriteTimeout() time.Duration

MetadataReadAfterWriteTimeout ...

func MetadataTimeout

func MetadataTimeout() time.Duration

MetadataTimeout ...

func MinDelay

func MinDelay() time.Duration

MinDelay ...

func NormalDelay

func NormalDelay() time.Duration

NormalDelay returns the duration for a normal delay

func OperationTimeout

func OperationTimeout() time.Duration

OperationTimeout ...

func RebootTimeout

func RebootTimeout() time.Duration

func SSHConnectionTimeout

func SSHConnectionTimeout() time.Duration

SSHConnectionTimeout ...

func SmallDelay

func SmallDelay() time.Duration

SmallDelay is a synonym for MinDelay

Types

type Delays

type Delays struct {
	Small  time.Duration `json:"delay_small,omitempty" mapstructure:"small"`
	Normal time.Duration `json:"delay_normal,omitempty" mapstructure:"normal"`
	Big    time.Duration `json:"delay_big,omitempty" mapstructure:"big"`
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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