command

package
v0.0.0-...-22f98ec Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PREFIX = "/home/r"
	WORKDIR        = "/var/rogi"
	DATAFILE       = WORKDIR + "/rogi.db"
	SETTING_BUCKET = "setting"
)
View Source
const (
	FTDir = iota
	FTFile
	FTBinary
	FTGlob
	FTConfig
)
View Source
const (
	TTNone = iota
	TTTemplate
	TTExpand
)

Variables

View Source
var Debug bool

Debug shows debug messages in functions like Run.

Functions

func InitEnv

func InitEnv()

func Run

func Run(command string) (output []byte, err error)

Run executes external commands just like RunWithMatch, but does not return the boolean `match`.

func RunWithMatch

func RunWithMatch(command string) (output []byte, match bool, err error)

func RunWithMatchf

func RunWithMatchf(format string, args ...interface{}) ([]byte, bool, error)

RunWithMatchf is like RunWithMatch, but formats its arguments according to the format. Analogous to Printf().

func Runf

func Runf(format string, args ...interface{}) ([]byte, error)

Runf is like Run, but formats its arguments according to the format. Analogous to Printf().

Types

type ActivateCommand

type ActivateCommand struct {
	UI cli.Ui
}

func (*ActivateCommand) Help

func (c *ActivateCommand) Help() string

func (*ActivateCommand) Run

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

Run will return integer as true or false.

func (*ActivateCommand) Synopsis

func (c *ActivateCommand) Synopsis() string

type CleanCommand

type CleanCommand struct {
	UI cli.Ui
}

func (*CleanCommand) Help

func (c *CleanCommand) Help() string

func (*CleanCommand) Run

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

Run will return integer as true or false.

func (*CleanCommand) Synopsis

func (c *CleanCommand) Synopsis() string

type EnvCommand

type EnvCommand struct {
	UI cli.Ui
}

func (*EnvCommand) Help

func (c *EnvCommand) Help() string

func (*EnvCommand) Run

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

Run will return integer as true or false.

func (*EnvCommand) Synopsis

func (c *EnvCommand) Synopsis() string

type FileObject

type FileObject struct {
	FTType  FileType
	TType   TemplateType
	Mode    int64
	Size    int64
	ModTime time.Time
	Uname   string
	Gname   string
	Target  string
	Source  string
}

type FileObjects

type FileObjects []FileObject

type FileType

type FileType int

type PackageObject

type PackageObject struct {
	Name      string          `toml:"name"`
	Version   string          `toml:"version"`
	LongDesc  string          `toml:"long_desc"`
	ShortDesc string          `toml:"short_desc"`
	Custodian string          `toml:"custodian"`
	Homepage  string          `toml:"homepage,omitempty"`
	Scripts   ScriptObject    `toml:"scripts,omitempty"`
	Settings  *SettingObjects `toml:"settings,omitempty"`
	Owner     string          `toml:"owner,omitempty"`
	Group     string          `toml:"group,omitempty"`
	Mode      string          `toml:"mode,omitempty"`
	Files     []string        `toml:"files,omitempty"`
	FDetail   *FileObjects    `toml:"fdetail,omitempty"`
}

type ScriptObject

type ScriptObject struct {
	Start       string `toml:"start,omitempty"`
	PreInstall  string `toml:"preinstall,omitempty"`
	PostInstall string `toml:"postinstall,omitempty"`
	Stop        string `toml:"stop,omitempty"`
}

type SetCommand

type SetCommand struct {
	UI cli.Ui
}

func (*SetCommand) Help

func (c *SetCommand) Help() string

func (*SetCommand) Run

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

func (*SetCommand) Synopsis

func (c *SetCommand) Synopsis() string

type SettingObject

type SettingObject struct {
	Package string      `db:"pkg"`
	Key     string      `db:"key"`
	Value   interface{} `db:"value"`
}

type SettingObjects

type SettingObjects []SettingObject

type StateObject

type StateObject struct {
	Packages map[string]string                 `toml:"packages"`
	Settings map[string]map[string]interface{} `toml:"settings"`
}

type TemplateType

type TemplateType int

type UnsetCommand

type UnsetCommand struct {
	UI cli.Ui
}

func (*UnsetCommand) Help

func (c *UnsetCommand) Help() string

func (*UnsetCommand) Run

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

Run will return integer as true or false.

func (*UnsetCommand) Synopsis

func (c *UnsetCommand) Synopsis() string

type VersionCommand

type VersionCommand struct {
	Version  string
	Revision string
	Ui       cli.Ui
}

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

func (c *VersionCommand) Run(_ []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