cmd

package
v0.0.0-...-51d156b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(command Command) func(*cli.Context)

Action wraps a Command with a function that can be used with the cli package.

func NewCondCommand

func NewCondCommand() *condCommand

NewCondCommand returns a Command that attenuates an opaque object auth with caveat conditions.

func NewDeleteCommand

func NewDeleteCommand() *deleteCommand

NewDeleteCommand returns a Command that deletes an opaque object.

func NewFetchCommand

func NewFetchCommand() *fetchCommand

NewFetchCommand returns a Command that fetches an opaque object.

func NewKeyCommand

func NewKeyCommand() *keyCommand

NewKeyCommand returns a Command that displays the client's public key.

func NewNewCommand

func NewNewCommand() *newCommand

NewNewCommand returns a Command that creates a new opaque object.

Types

type Command

type Command interface {
	// CLICommand returns an initialized cli.Command.
	CLICommand() cli.Command

	// Do implements the command action.
	Do(ctx Context) error
}

Command defines an ooclient subcommand.

type Context

type Context interface {
	// Args returns a slice of string arguments after flags are parsed.
	Args() []string

	// Bool returns the boolean value specified for the given flag name.
	Bool(flagName string) bool

	// ShowAppHelp prints command usage to the terminal.
	ShowAppHelp()

	// String returns the value specified for the given flag name, or empty
	// string if not set.
	String(flagName string) string

	// Stdin returns the reader from standard input.
	Stdin() io.ReadCloser

	// Stdout returns the writer to standard output.
	Stdout() io.WriteCloser
}

Context defines the command-line flags and other parameters exposed from the command-line.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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