Documentation ¶
Index ¶
- Constants
- func GetWaitCmd(task proxmox.Task) string
- func TaskStatus(ctx context.Context, task proxmox.Task) (string, error)
- func WaitTask(ctx context.Context, task *proxmox.Task, opts ...WaitOption) (err error)
- func Watch(ctx context.Context, start int, t *proxmox.Task) (chan string, error)
- type PollingOption
- type SpinnerOption
- type WaitOption
Constants ¶
View Source
const ( DefaultTimeout = 60 * time.Second DefaultPollDuration = time.Millisecond * 500 DefaultSpinnerCharSet = 9 // Classic Unix quiet |/-\| )
Variables ¶
This section is empty.
Functions ¶
func GetWaitCmd ¶
func GetWaitCmd(task proxmox.Task) string
func TaskStatus ¶
TaskStatus updates the task and returns a message explaining the task's status
Types ¶
type PollingOption ¶
type PollingOption func(c *pollingConfig)
PollingOption is a function used to set items in the pollingConfig struct.
func WithPollDuration ¶
func WithPollDuration(pollDuration time.Duration) PollingOption
WithPollDuration sets the interval between task polls.
func WithTimeout ¶
func WithTimeout(timeout time.Duration, stopTaskOnTimeout bool) PollingOption
WithTimeout is a PollingOption that starts a timeout (for `timeout`). The timeout will optionally stop the task on timeout (stopTaskOnTimeout)
type SpinnerOption ¶
type SpinnerOption func(c *spinnerConfig)
func WithSpinnerCharSet ¶
func WithSpinnerCharSet(charset int) SpinnerOption
func WithSpinnerSpeed ¶
func WithSpinnerSpeed(speed time.Duration) SpinnerOption
type WaitOption ¶
type WaitOption func(c *waitConfig)
func WithOutput ¶
func WithOutput() WaitOption
func WithPolling ¶
func WithPolling(opts ...PollingOption) WaitOption
WithPolling enables polling the task every pollDuration. WithPolling also optionally enables a timeout (WithTimeout).
func WithSpinner ¶
func WithSpinner(opts ...SpinnerOption) WaitOption
Click to show internal directories.
Click to hide internal directories.