Documentation
¶
Index ¶
- Variables
- type Application
- func (a *Application) AddClient(name, description string, opts ...Option) *Command
- func (a *Application) AddServer(name, description string, opts ...Option) *Command
- func (a *Application) ExitOnError(ctx context.Context, args ...string)
- func (a *Application) Run(ctx context.Context, args ...string) error
- type ApplicationOption
- type Command
- type Commander
- type InputConfig
- type Option
- type OutputConfig
- type RegisterFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewInputConfig), fx.Provide(NewOutputConfig), )
Module for fx.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application for cmd.
func NewApplication ¶
func NewApplication(register RegisterFunc, opts ...ApplicationOption) *Application
NewApplication for cmd.
func (*Application) AddClient ¶
func (a *Application) AddClient(name, description string, opts ...Option) *Command
AddClient sub command.
func (*Application) AddServer ¶
func (a *Application) AddServer(name, description string, opts ...Option) *Command
AddServer sub command.
func (*Application) ExitOnError ¶
func (a *Application) ExitOnError(ctx context.Context, args ...string)
ExitOnError will run the application and exit on error.
type ApplicationOption ¶
type ApplicationOption interface {
// contains filtered or unexported methods
}
ApplicationOption for cmd.
func WithApplicationExit ¶
func WithApplicationExit(exit os.ExitFunc) ApplicationOption
WithApplicationExit for cmd.
func WithApplicationName ¶
func WithApplicationName(name env.Name) ApplicationOption
WithApplicationName for cmd.
func WithApplicationVersion ¶
func WithApplicationVersion(version env.Version) ApplicationOption
WithApplicationVersion for cmd.
type Commander ¶
type Commander interface {
// AddServer sub command.
AddServer(name, description string, opts ...Option) *Command
// AddClient sub command.
AddClient(name, description string, opts ...Option) *Command
}
Commander allows adding different sub commands.
type InputConfig ¶
InputConfig for cmd.
type OutputConfig ¶
OutputConfig for cmd.
Click to show internal directories.
Click to hide internal directories.