Help us shape the future of Go! Take the 2026 Go Developer Survey

command

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2016 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Help

func Help(command, name string) string

func HelpFunc

func HelpFunc(commands map[string]cli.CommandFactory) string

Help is a custom help func for the cli. It's the same as cli.BasicHelpFunc but contains our global configuration

func NewCopy

func NewCopy(config *Config) cli.CommandFactory

func NewDelete

func NewDelete(config *Config) cli.CommandFactory

func NewList

func NewList(config *Config) cli.CommandFactory

func NewModify

func NewModify(config *Config) cli.CommandFactory

func NewVersion

func NewVersion(version string) cli.CommandFactory

func Provider

func Provider(name string, args []string) (interface{}, []string, error)

Provider returns the provider with the given name and the filtered remaining arguments. Each provider is responsible of how the remaining arguments are returned.

Types

type Config

type Config struct {
	// Providers define the providers to be used with images. Example: ["aws",
	// "do"]. The special ["all"] name matches all providers.
	Providers []string `toml:"providers" json:"providers"`

	// NoColor disables color output
	NoColor bool `toml:"no_color" json:"no_color"`

	// Force disables asking for user input for certain actions, such as
	// "delete"
	Force bool `toml:"force" json:"force"`

	Ui cli.Ui `toml:"-" json:"-"`
}

Config defines the global flag set of images

func Load

func Load(args []string) (*Config, []string, error)

Load tries to read the global configurations from flag, env or a toml file.

func (*Config) Help

func (c *Config) Help() map[string]string

Help returns the help messages of the respective commands

type Copier

type Copier interface {
	Copy(args []string) error
}

Copier copyies the image.

type Copy

type Copy struct {
	*Config
}

func (*Copy) Help

func (c *Copy) Help() string

func (*Copy) Run

func (c *Copy) Run(args []string) int

func (*Copy) Synopsis

func (c *Copy) Synopsis() string

type Delete

type Delete struct {
	*Config
}

func (*Delete) Help

func (d *Delete) Help() string

func (*Delete) Run

func (d *Delete) Run(args []string) int

func (*Delete) Synopsis

func (d *Delete) Synopsis() string

type Deleter

type Deleter interface {
	Delete(args []string) error
}

Deleter delets images

type Helper

type Helper interface {
	Help(command string) string
}

Helper returns the help message

type List

type List struct {
	*Config
}

func (*List) Help

func (l *List) Help() string

func (*List) Run

func (l *List) Run(args []string) int

func (*List) Synopsis

func (l *List) Synopsis() string

type Lister

type Lister interface {
	List(args []string) error
}

Lister lists and prints the images

type Modifier

type Modifier interface {
	Modify(args []string) error
}

Modifier modifies image attributes

type Modify

type Modify struct {
	*Config
}

func (*Modify) Help

func (m *Modify) Help() string

func (*Modify) Run

func (m *Modify) Run(args []string) int

func (*Modify) Synopsis

func (m *Modify) Synopsis() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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