Documentation
¶
Index ¶
- func JsonOutput(data interface{})
- func Register(parser *flags.Parser)
- func RenderProgramIni(appName, username, absDir, command string) string
- type CtlCommand
- type GetEnvCommand
- type InstallCommand
- type PidCommand
- type ReloadCommand
- type RemoveCommand
- type RestartCommand
- type SetEnvCommand
- type ShutdownCommand
- type SignalCommand
- type StartCommand
- type StatusCommand
- type StopCommand
- type TailCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register wires the ctl subcommand and its sub-subcommands (status, start, stop, restart, shutdown, reload, install, remove, get-env, set-env, signal, pid, tail) into the supplied go-flags parser.
The supd root package calls this from its init() so that the global `parser` variable does not have to be exported into this package.
func RenderProgramIni ¶
RenderProgramIni builds the body of a program:xxx ini section for `supd ctl install <exec_path> [--args]`. It is exported so other packages (notably the setup installer) can reuse the same template without duplicating the literal format string.
appName: program name without extension (e.g. "myapp") username: OS user the program runs as absDir: absolute directory containing the executable command: full command line including any flags the user passed
The output is wrapped with leading and trailing newlines so it can be dropped into an ini file without polluting adjacent sections.
Types ¶
type CtlCommand ¶
type CtlCommand struct {
ServerUrl string `short:"s" long:"serverurl" description:"URL on which supervisord server is listening"`
User string `short:"u" long:"user" description:"the user name"`
Password string `short:"P" long:"password" description:"the password"`
Verbose bool `short:"v" long:"verbose" description:"Show verbose debug information"`
Encode string `short:"o" long:"output" description:"set output encode for ctl command, value is txt or json, default is txt"`
Follow bool `short:"f" long:"follow" description:"The -f option causes tail to not stop when end of file is reached."`
}
func (*CtlCommand) PrintErr ¶
func (x *CtlCommand) PrintErr(err error)
func (*CtlCommand) Println ¶
func (x *CtlCommand) Println(msg string)
type GetEnvCommand ¶
type GetEnvCommand struct {
}
func (*GetEnvCommand) Execute ¶
func (c *GetEnvCommand) Execute(args []string) error
type InstallCommand ¶
type InstallCommand struct {
Name string `short:"n" description:"if -n not set, the bin name will be used."`
}
func (*InstallCommand) Execute ¶
func (c *InstallCommand) Execute(args []string) error
func (*InstallCommand) Usage ¶
func (c *InstallCommand) Usage() string
type PidCommand ¶
type PidCommand struct {
}
func (*PidCommand) Execute ¶
func (c *PidCommand) Execute(args []string) error
type ReloadCommand ¶
type ReloadCommand struct {
}
func (*ReloadCommand) Execute ¶
func (c *ReloadCommand) Execute(args []string) error
type RemoveCommand ¶
type RemoveCommand struct {
}
func (*RemoveCommand) Execute ¶
func (c *RemoveCommand) Execute(args []string) error
func (*RemoveCommand) Usage ¶
func (c *RemoveCommand) Usage() string
type RestartCommand ¶
type RestartCommand struct {
}
func (*RestartCommand) Execute ¶
func (rc *RestartCommand) Execute(args []string) error
type SetEnvCommand ¶
type SetEnvCommand struct {
}
func (*SetEnvCommand) Execute ¶
func (c *SetEnvCommand) Execute(args []string) error
type ShutdownCommand ¶
type ShutdownCommand struct {
}
func (*ShutdownCommand) Execute ¶
func (c *ShutdownCommand) Execute(args []string) error
type SignalCommand ¶
type SignalCommand struct {
}
func (*SignalCommand) Execute ¶
func (c *SignalCommand) Execute(args []string) error
type StartCommand ¶
type StartCommand struct {
}
func (*StartCommand) Execute ¶
func (c *StartCommand) Execute(args []string) error
type StatusCommand ¶
type StatusCommand struct {
}
func (*StatusCommand) Execute ¶
func (c *StatusCommand) Execute(args []string) error
type StopCommand ¶
type StopCommand struct {
}
func (*StopCommand) Execute ¶
func (c *StopCommand) Execute(args []string) error
type TailCommand ¶
type TailCommand struct {
Follow bool `short:"f" description:"The -f option causes tail to not stop when end of file is reached."`
}
func (*TailCommand) Execute ¶
func (c *TailCommand) Execute(args []string) error