command

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAppfile is the default filename for the Appfile
	DefaultAppfile = "Appfile"

	// DefaultLocalDataDir is the default path to the local data
	// directory.
	DefaultLocalDataDir         = "~/.otto.d"
	DefaultLocalDataDetectorDir = "detect"

	// DefaultOutputDir is the default filename for the output directory
	DefaultOutputDir                = ".otto"
	DefaultOutputDirCompiledAppfile = "appfile"
	DefaultOutputDirCompiledData    = "compiled"
	DefaultOutputDirLocalData       = "data"

	// DefaultDataDir is the default directory for the directory
	// data if a directory in the Appfile isn't specified.
	DefaultDataDir = "otto-data"
)

Variables

This section is empty.

Functions

func NewUi

func NewUi(raw cli.Ui) ui.Ui

NewUi returns a new otto Ui implementation for use around the given CLI Ui implementation.

Types

type BuildCommand

type BuildCommand struct {
	Meta
}

BuildCommand is the command that builds a deployable artifact for this version of the app.

func (*BuildCommand) Help

func (c *BuildCommand) Help() string

func (*BuildCommand) Run

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

func (*BuildCommand) Synopsis

func (c *BuildCommand) Synopsis() string

type CompileCommand

type CompileCommand struct {
	Meta

	Detectors []*detect.Detector
}

CompileCommand is the command that is responsible for "compiling" the Appfile into a set of data that is used by the other commands for execution.

func (*CompileCommand) Help

func (c *CompileCommand) Help() string

func (*CompileCommand) Run

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

func (*CompileCommand) Synopsis

func (c *CompileCommand) Synopsis() string

type DeployCommand

type DeployCommand struct {
	Meta
}

DeployCommand is the command that deploys the app once it is built.

func (*DeployCommand) Help

func (c *DeployCommand) Help() string

func (*DeployCommand) Run

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

func (*DeployCommand) Synopsis

func (c *DeployCommand) Synopsis() string

type DevCommand

type DevCommand struct {
	Meta
}

DevCommand is the command that manages (starts, stops, etc.) the development environment for an Appfile.

func (*DevCommand) Help

func (c *DevCommand) Help() string

func (*DevCommand) Run

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

func (*DevCommand) Synopsis

func (c *DevCommand) Synopsis() string

type FlagSetFlags

type FlagSetFlags uint

FlagSetFlags is an enum to define what flags are present in the default FlagSet returned by Meta.FlagSet

const (
	FlagSetNone FlagSetFlags = 0
)

type InfraCommand

type InfraCommand struct {
	Meta
}

InfraCommand is the command that sets up the infrastructure for an Appfile.

func (*InfraCommand) Help

func (c *InfraCommand) Help() string

func (*InfraCommand) Run

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

func (*InfraCommand) Synopsis

func (c *InfraCommand) Synopsis() string

type Meta

type Meta struct {
	CoreConfig *otto.CoreConfig
	Ui         cli.Ui
}

Meta are the meta-options that are available on all or most commands.

func (*Meta) Appfile

func (m *Meta) Appfile() (*appfile.Compiled, error)

Appfile loads the compiled Appfile. If the Appfile isn't compiled yet, then an error will be returned.

func (*Meta) Core

func (m *Meta) Core(f *appfile.Compiled) (*otto.Core, error)

Core returns the core for the given Appfile. The file where the Appfile was loaded from should be set in appfile.File.Path. This root appfile path will be used as the default output directory for Otto.

func (*Meta) DataDir

func (m *Meta) DataDir() (string, error)

DataDir returns the user-local data directory for Otto.

func (*Meta) Directory

func (m *Meta) Directory(config *otto.CoreConfig) (directory.Backend, error)

Directory returns the Otto directory backend for the given Appfile. If no directory backend is specified, a local folder will be used.

func (*Meta) FlagSet

func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet

FlagSet returns a FlagSet with the common flags that every command implements. The exact behavior of FlagSet can be configured using the flags as the second parameter.

func (*Meta) OttoUi

func (m *Meta) OttoUi() ui.Ui

OttoUi returns the ui.Ui object.

func (*Meta) RootDir

func (m *Meta) RootDir() (string, error)

RootDir finds the "root" directory. This is the working directory of the Appfile and Otto itself. To find the root directory, we traverse upwards until we find the ".otto" directory and assume that is where it is.

type StatusCommand

type StatusCommand struct {
	Meta
}

StatusCommand is the command that shows the status of the various stages of this application.

func (*StatusCommand) Help

func (c *StatusCommand) Help() string

func (*StatusCommand) Run

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

func (*StatusCommand) Synopsis

func (c *StatusCommand) Synopsis() string

type VersionCheckFunc

type VersionCheckFunc func() (VersionCheckInfo, error)

VersionCheckFunc is the callback called by the Version command to check if there is a new version of Otto.

type VersionCheckInfo

type VersionCheckInfo struct {
	Outdated bool
	Latest   string
	Alerts   []string
}

VersionCheckInfo is the return value for the VersionCheckFunc callback and tells the Version command information about the latest version of Otto.

type VersionCommand

type VersionCommand struct {
	Meta

	Revision          string
	Version           string
	VersionPrerelease string
	CheckFunc         VersionCheckFunc
}

VersionCommand is a Command implementation prints the version.

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

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

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

Jump to

Keyboard shortcuts

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