block

package
v0.0.0-...-f19ae85 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2015 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessBlockedError

func ProcessBlockedError(err error, block Block) error

ProcessBlockedError ensures that correct and user-friendly message is displayed to the user based on the block type.

Types

type Block

type Block int8

Block describes block type

const (
	// BlockDestroy describes the block that
	// blocks destroy- commands
	BlockDestroy Block = iota

	// BlockRemove describes the block that
	// blocks remove- commands
	BlockRemove

	// BlockChange describes the block that
	// blocks change commands
	BlockChange
)

type BlockCommand

type BlockCommand struct {
	ProtectionCommand
}

BlockCommand blocks specified operation.

func (*BlockCommand) Info

func (c *BlockCommand) Info() *cmd.Info

Info provides information about command. Satisfying Command interface.

func (*BlockCommand) Init

func (c *BlockCommand) Init(args []string) error

Init initializes the command. Satisfying Command interface.

func (*BlockCommand) Run

func (c *BlockCommand) Run(_ *cmd.Context) error

Run blocks commands from running successfully. Satisfying Command interface.

type ClientAPI

type ClientAPI interface {
	Close() error
	EnvironmentSet(config map[string]interface{}) error
}

BlockClientAPI defines the client API methods that the protection command uses.

type ProtectionCommand

type ProtectionCommand struct {
	envcmd.EnvCommandBase
	// contains filtered or unexported fields
}

ProtectionCommand is a super for environment protection commands that block/unblock operations.

type UnblockCommand

type UnblockCommand struct {
	ProtectionCommand
}

UnblockCommand removes the block from desired operation.

func (*UnblockCommand) Info

func (c *UnblockCommand) Info() *cmd.Info

Info provides information about command. Satisfying Command interface.

func (*UnblockCommand) Init

func (c *UnblockCommand) Init(args []string) error

Init initializes the command. Satisfying Command interface.

func (*UnblockCommand) Run

func (c *UnblockCommand) Run(_ *cmd.Context) error

Run unblocks previously blocked commands. Satisfying Command interface.

Jump to

Keyboard shortcuts

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