Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBindAddr = "127.0.0.1:8080" DefaultServiceUser = os.Getenv("USER") )
Functions ¶
Types ¶
type Cli ¶
type Cli struct {
App *cliv2.App
WebServiceProvider interfaces.WebServiceProvider
Args []string
Install bool // NB: Flag variable.
Uninstall bool // NB: Flag variable.
ServiceUser string // NB: Flag variable.
BindAddr string // NB: Flag variable.
ExitOnError bool // true triggers os.exit upon error from Main().
// contains filtered or unexported fields
}
Cli provides a command-line-interface in-a-box for web-services.
func (*Cli) DefaultAction ¶
DefaultAction can be overriden by setting cli.App.Action after invoking `Init()`.
func (*Cli) Init ¶
Init performs validation and when possible auto-populates absent fields with the `os` package equivalent (e.g. if `cli.App.Writer == nil` then it is set to `os.Stderr`) or other default value.
func (*Cli) ServiceManagementHandler ¶
ServiceManagementHandler performs system service management updates.
type Options ¶
type Options struct {
AppName string
Usage string
Version string
Flags []cliv2.Flag
Stdout io.Writer
Stderr io.Writer
WebServiceProvider interfaces.WebServiceProvider
Args []string
ExitOnError bool // Exit on non-nil error during invocation of `Main()`.
}
Options provider for Cli struct.
Click to show internal directories.
Click to hide internal directories.