cli

package
v0.0.0-...-db86c90 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalCommands = make(map[string]Command)

GlobalCommands stores all the daolictl command

Functions

func Subcmd

func Subcmd(name string, synopses []string, description string, exitOnError bool) *flag.FlagSet

Subcmd is a subcommand of the main "daolictl" command. A subcommand represents an action that can be performed from the Daoli command line client.

To see all available subcommands, run "docker --help".

Types

type Cli

type Cli struct {
	Stderr io.Writer

	Usage func()
	// contains filtered or unexported fields
}

Cli represents a command line interface

func New

func New(handler Handler) *Cli

New instantiates a ready-to-use Cli.

func (*Cli) CmdHelp

func (cli *Cli) CmdHelp(args ...string) error

Usage: daolictl help COMMAND or docker COMMAND --help

func (*Cli) Run

func (cli *Cli) Run(args ...string) error

Run executes the specified command.

type ClientFlags

type ClientFlags struct {
	FlagSet   *flag.FlagSet
	Common    *CommonFlags
	PostParse func()
}

ClientFlags represents flags for the daolictl client.

type Command

type Command struct {
	Name        string
	Description string
}

Command is the struct containing the command name and description

type CommonFlags

type CommonFlags struct {
	FlagSet   *flag.FlagSet
	PostParse func()

	Debug      bool
	Hosts      []string
	LogLevel   string
	TLS        bool
	TLSVerify  bool
	TLSOptions *Options
}

CommonFlags represents flags that are common to the client.

type Handler

type Handler interface{}

Handler holds the different commands Cli will call It should have methods with names starting with `Cmd` like:

func (h myHandler) CmdFoo(args ...string) error

type Initializer

type Initializer interface {
	Initialize() error
}

Initializer can be optionally implemented by a Handler to initialize before each call to one of its commands.

type Options

type Options struct {
	CAFile   string
	CertFile string
	KeyFile  string

	// client-only option
	InsecureSkipVerify bool
}

Jump to

Keyboard shortcuts

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