clistate

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MPL-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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