Documentation ¶
Index ¶
- func NewRun(r RunFunc) runFunInfo
- type App
- type AppBuilder
- func (a *AppBuilder) BindOptions(key string, options interface{})
- func (ab *AppBuilder) Build() (*App, error)
- func (a *AppBuilder) ConfigureServices(action RunFunc)
- func (ab *AppBuilder) Info(use string, short string, description string) *AppBuilder
- func (a *AppBuilder) OrderPostRun(order int, action RunFunc)
- func (a *AppBuilder) OrderPreRun(order int, action RunFunc)
- func (a *AppBuilder) OrderRun(order int, action RunFunc)
- func (a *AppBuilder) PostRun(action RunFunc)
- func (a *AppBuilder) PreRun(action RunFunc)
- func (a *AppBuilder) Run(action RunFunc)
- func (a *AppBuilder) Use(action func(*AppBuilder)) *AppBuilder
- func (ab *AppBuilder) Version(version string) *AppBuilder
- type AppContext
- func (a *AppContext) OrderRun(order int, action RunFunc)
- func (a *AppContext) PostOrderRun(order int, action RunFunc)
- func (a *AppContext) PostRun(action RunFunc)
- func (a *AppContext) PreOrderRun(order int, action RunFunc)
- func (a *AppContext) PreRun(action RunFunc)
- func (a *AppContext) Run(action RunFunc)
- type CommandBuilder
- type ConfigureFunc
- type RunFunc
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppBuilder ¶
type AppBuilder struct { Context *AppContext CmdBuilder *CommandBuilder }
func NewAppBuilder ¶
func NewAppBuilder() *AppBuilder
func (*AppBuilder) BindOptions ¶
func (a *AppBuilder) BindOptions(key string, options interface{})
func (*AppBuilder) Build ¶
func (ab *AppBuilder) Build() (*App, error)
func (*AppBuilder) ConfigureServices ¶
func (a *AppBuilder) ConfigureServices(action RunFunc)
func (*AppBuilder) Info ¶
func (ab *AppBuilder) Info(use string, short string, description string) *AppBuilder
func (*AppBuilder) OrderPostRun ¶
func (a *AppBuilder) OrderPostRun(order int, action RunFunc)
func (*AppBuilder) OrderPreRun ¶
func (a *AppBuilder) OrderPreRun(order int, action RunFunc)
func (*AppBuilder) OrderRun ¶
func (a *AppBuilder) OrderRun(order int, action RunFunc)
func (*AppBuilder) PostRun ¶
func (a *AppBuilder) PostRun(action RunFunc)
func (*AppBuilder) PreRun ¶
func (a *AppBuilder) PreRun(action RunFunc)
func (*AppBuilder) Run ¶
func (a *AppBuilder) Run(action RunFunc)
func (*AppBuilder) Use ¶
func (a *AppBuilder) Use(action func(*AppBuilder)) *AppBuilder
func (*AppBuilder) Version ¶
func (ab *AppBuilder) Version(version string) *AppBuilder
type AppContext ¶
type AppContext struct { PreRuns []runFunInfo Runs []runFunInfo PostRuns []runFunInfo Name string Short string Description string Version string }
func NewAppContext ¶
func NewAppContext() *AppContext
func (*AppContext) OrderRun ¶
func (a *AppContext) OrderRun(order int, action RunFunc)
func (*AppContext) PostOrderRun ¶
func (a *AppContext) PostOrderRun(order int, action RunFunc)
func (*AppContext) PostRun ¶
func (a *AppContext) PostRun(action RunFunc)
func (*AppContext) PreOrderRun ¶
func (a *AppContext) PreOrderRun(order int, action RunFunc)
func (*AppContext) PreRun ¶
func (a *AppContext) PreRun(action RunFunc)
func (*AppContext) Run ¶
func (a *AppContext) Run(action RunFunc)
type CommandBuilder ¶
func NewCommandBuilder ¶
func NewCommandBuilder() *CommandBuilder
func (*CommandBuilder) AddCommand ¶
func (b *CommandBuilder) AddCommand(cmd *cobra.Command)
func (*CommandBuilder) AddRun ¶
func (b *CommandBuilder) AddRun(use string, short string, run func())
func (*CommandBuilder) Build ¶
func (cb *CommandBuilder) Build(ac *AppContext) (*cobra.Command, error)
type ConfigureFunc ¶
type ConfigureFunc = func() error
type VersionInfo ¶
func (*VersionInfo) String ¶
func (v *VersionInfo) String() string
Click to show internal directories.
Click to hide internal directories.