clistate

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package state exposes common helpers for working with state from the CLI.

This is a separate package so that backends can use this for consistent messaging without creating a circular reference to the command package.

Index

Constants

View Source
const (
	LockThreshold    = 400 * time.Millisecond
	LockMessage      = "Acquiring state lock. This may take a few moments..."
	LockErrorMessage = `` /* 295-byte string literal not displayed */

	UnlockMessage      = "Releasing state lock. This may take a few moments..."
	UnlockErrorMessage = `` /* 787-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func Lock

func Lock(ctx context.Context, s state.State, info *state.LockInfo, ui cli.Ui, color *colorstring.Colorize) (string, error)

Lock locks the given state and outputs to the user if locking is taking longer than the threshold. The lock is retried until the context is cancelled.

func Unlock

func Unlock(s state.State, id string, ui cli.Ui, color *colorstring.Colorize) error

Unlock unlocks the given state and outputs to the user if the unlock fails what can be done.

Types

This section is empty.

Jump to

Keyboard shortcuts

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