cmd

package
v0.0.0-...-74c434d Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

The Command Interfaces

This package contains a set of interfaces, commands must or can implement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Shell() string
}

The Command interface is used to have specialized commands that are used for execution and logging (the latter is useful to hide the gory details of more complex commands).

type Logger

type Logger interface {
	Logging() string
}

The Logger interface should be implemented by commands, which hide their intent behind a series of complex shell commands. The returned string will be printed instead of the raw output of the Shell function.

type Renderer

type Renderer interface {
	Render(i interface{})
}

Often it is convenient to directly use values or methods of the template in the commands (using go's templating mechanism).

type StdinConsumer

type StdinConsumer interface {
	Input() io.ReadCloser
}

If a command needs to send something to the remote host (a file for example) the content can be made available on standard input of the remote command. The command must make sure that changed local content will reissue execution of the command (by printing the content's hash to standard output for example).

type Validator

type Validator interface {
	Validate() error
}

Interface used for types that will validate its state. An error is returned if the state is invalid.

Jump to

Keyboard shortcuts

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