block

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatModelBlockInfo

func FormatModelBlockInfo(all []params.ModelBlockInfo) ([]modelBlockInfo, error)

func FormatTabularBlockedModels

func FormatTabularBlockedModels(writer io.Writer, value interface{}) error

FormatTabularBlockedModels writes out tabular format for blocked models. This method is exported as it is also used by destroy-model.

func NewDisableCommand

func NewDisableCommand() cmd.Command

NewDisableCommand returns a disable-command command instance that will use the default API.

func NewEnableCommand

func NewEnableCommand() cmd.Command

NewEnableCommand returns a new command that eanbles previously disabled command sets.

func NewListCommand

func NewListCommand() cmd.Command

NewListCommand returns the command that lists the disabled commands for the model.

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 BlockInfo

type BlockInfo struct {
	Commands string `yaml:"command-set" json:"command-set"`
	Message  string `yaml:"message,omitempty" json:"message,omitempty"`
}

BlockInfo defines the serialization behaviour of the block information.

Jump to

Keyboard shortcuts

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