command

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DatasetFilename is the filename of the file that contains the dataset ID in the data folder.
	DatasetFilename = ".dataset"
	//DatasetPermissions are the permissions for DatasetFilename
	DatasetPermissions = 0644
)
View Source
const (
	OutputDirPermissions = 0755
)

Variables

This section is empty.

Functions

func AlwaysOverwriteHandler added in v0.3.1

func AlwaysOverwriteHandler(file string) bool

AlwaysOverwriteHandler is a handler that tells to always overwrite a file.

func DownloadFactory

func DownloadFactory() func() (cmd cli.Command, err error)

DownloadFactory returns a factory method for the join command

func ErrorCauser

func ErrorCauser(err error) error

ErrorCauser returns the error that is one level up in the error chain.

func HandleError

func HandleError(err error, verbose bool)

HandleError handles the way errors are presented to the user.

func LoginFactory

func LoginFactory() func() (cmd cli.Command, err error)

LoginFactory returns a factory method for the join command

func LogsFactory

func LogsFactory() func() (cmd cli.Command, err error)

LogsFactory returns a factory method for the join command

func NewClient

func NewClient(ui cli.Ui) (*client.NerdAPIClient, error)

NewClient creates a new NerdAPIClient with two credential providers.

func OverwriteHandlerUserPrompt added in v0.3.1

func OverwriteHandlerUserPrompt(ui cli.Ui) func(string) bool

OverwriteHandlerUserPrompt is a handler that checks wether a file should be overwritten by asking the user over Stdin.

func RunFactory

func RunFactory() func() (cmd cli.Command, err error)

RunFactory returns a factory method for the join command

func StatusFactory

func StatusFactory() func() (cmd cli.Command, err error)

StatusFactory returns a factory method for the join command

func UploadFactory

func UploadFactory() func() (cmd cli.Command, err error)

UploadFactory returns a factory method for the join command

func UserPassProvider added in v0.1.1

func UserPassProvider(ui cli.Ui) func() (string, string, error)

UserPassProvider prompts the username and password on stdin.

func WorkFactory

func WorkFactory() func() (cmd cli.Command, err error)

WorkFactory returns a factory method for the join command

Types

type ConfOpts

type ConfOpts struct {
	ConfigFile string `long:"config" default:"" default-mask:"" env:"CONFIG" description:"location of config file"`
	OutputOpts
}

type Download

type Download struct {
	// contains filtered or unexported fields
}

Download command

func (*Download) DoRun

func (cmd *Download) DoRun(args []string) (err error)

DoRun is called by run and allows an error to be returned

func (Download) Help

func (c Download) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Download) Run

func (c Download) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Download) Synopsis

func (c Download) Synopsis() string

Short explanation of the command as passed in the struction initialization

type DownloadOpts

type DownloadOpts struct {
	NerdOpts
	AlwaysOverwrite bool `long:"always-overwrite" default-mask:"false" description:"always overwrite files when they already exist"`
}

DownloadOpts describes command options

type Login

type Login struct {
	// contains filtered or unexported fields
}

Login command

func (*Login) DoRun

func (cmd *Login) DoRun(args []string) error

DoRun is called by run and allows an error to be returned

func (Login) Help

func (c Login) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Login) Run

func (c Login) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Login) Synopsis

func (c Login) Synopsis() string

Short explanation of the command as passed in the struction initialization

type LoginOpts

type LoginOpts struct {
	User string `long:"user" default:"" default-mask:"" env:"NERD_USER" description:"nerd username"`
	Pass string `long:"pass" default:"" default-mask:"" env:"NERD_PASS" description:"nerd password"`
	NerdOpts
}

LoginOpts describes command options

type Logs

type Logs struct {
	// contains filtered or unexported fields
}

Logs command

func (*Logs) DoRun

func (cmd *Logs) DoRun(args []string) (err error)

DoRun is called by run and allows an error to be returned

func (Logs) Help

func (c Logs) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Logs) Run

func (c Logs) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Logs) Synopsis

func (c Logs) Synopsis() string

Short explanation of the command as passed in the struction initialization

type LogsOpts

type LogsOpts struct {
	NerdOpts
}

LogsOpts describes command options

type NerdOpts

type NerdOpts struct {
	ConfOpts
}

NerdOpts are the options that are applicable to all nerd commands.

type OutputOpts

type OutputOpts struct {
	VerboseOutput bool `short:"v" long:"verbose" default-mask:"false" description:"show verbose output"`
	JSONOutput    bool `long:"json-format" default-mask:"false" description:"show output in json format"`
}

OutputOpts are options that are related to CLI output.

type Run

type Run struct {
	// contains filtered or unexported fields
}

Run command

func (*Run) DoRun

func (cmd *Run) DoRun(args []string) error

DoRun is called by run and allows an error to be returned

func (Run) Help

func (c Run) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Run) Run

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

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Run) Synopsis

func (c Run) Synopsis() string

Short explanation of the command as passed in the struction initialization

type RunOpts

type RunOpts struct {
	*NerdOpts

	Environment []string `short:"e" description:"container environment variables"`
}

RunOpts describes command options

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status command

func (*Status) DoRun

func (cmd *Status) DoRun(args []string) (err error)

DoRun is called by run and allows an error to be returned

func (Status) Help

func (c Status) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Status) Run

func (c Status) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Status) Synopsis

func (c Status) Synopsis() string

Short explanation of the command as passed in the struction initialization

type StatusOpts

type StatusOpts struct {
	NerdOpts
}

StatusOpts describes command options

type TaskContainer added in v0.2.3

type TaskContainer struct {
	// contains filtered or unexported fields
}

TaskContainer is a unique execution for a specific task

type TaskLogEvent added in v0.2.3

type TaskLogEvent struct {
	*TaskContainer
	// contains filtered or unexported fields
}

TaskLogEvent is a log event for a certain task container

type TaskStatus

type TaskStatus struct {
	TaskContainer
	// contains filtered or unexported fields
}

TaskStatus describes the container status of a task

type Upload

type Upload struct {
	// contains filtered or unexported fields
}

Upload command

func (*Upload) DoRun

func (cmd *Upload) DoRun(args []string) (err error)

DoRun is called by run and allows an error to be returned

func (Upload) Help

func (c Upload) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Upload) Run

func (c Upload) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Upload) Synopsis

func (c Upload) Synopsis() string

Short explanation of the command as passed in the struction initialization

type UploadOpts

type UploadOpts struct {
	NerdOpts
}

UploadOpts describes command options

type Work

type Work struct {
	// contains filtered or unexported fields
}

Work command

func (*Work) DoRun

func (cmd *Work) DoRun(args []string) (err error)

DoRun is called by run and allows an error to be returned

func (Work) Help

func (c Work) Help() string

Will write help text for when a user uses --help, it automatically renders all option groups of the flags.Parser (augmented with default values). It will show an extended help message if it is not empty, else it shows the synopsis.

func (Work) Run

func (c Work) Run(args []string) int

Run wraps a signature that allows returning an error type and parses the arguments for the flags package. If flag parsing fails it sets the exit code to 127, if the command implementation returns a non-nil error the exit code is 1

func (Work) Synopsis

func (c Work) Synopsis() string

Short explanation of the command as passed in the struction initialization

type WorkOpts

type WorkOpts struct {
	NerdOpts
	Capacity uint `short:"c" long:"capacity" default-mask:"1" description:"maximum number of tasks to accept"`
}

WorkOpts describes command options

Jump to

Keyboard shortcuts

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