Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // Use is the one-line usage message. // Recommended syntax is as follow: // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. // ... indicates that you can specify multiple values for the previous argument. // | indicates mutually exclusive information. You can use the argument to the left of the separator or the // argument to the right of the separator. You cannot use both arguments in a single use of the command. // { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are // optional, they are enclosed in brackets ([ ]). // Example: add [-F file | -D dir]... [-f format] profile Use() string // Short returns string about short description of the command // the string is shown in help screen of cobra command Short() string // Setup is used to setup flags or pre-run steps for the command. // // For example, // cmd.Flags().IntVarP(&r.num, "num", "n", 5, "description") // Setup(cmd *cobra.Command) // Run runs the command runner // run returns command runner which is a function with dependency // injected arguments. // // For example, // Command{ // Run: func(l lib.Logger) { // l.Info("i am working") // }, // } // Run(cmd *cobra.Command) CommandRunner // TODO, RunE instead? }
Command interface is used to implement sub-commands in the system.
func NewHTTPServerCommand ¶
func NewHTTPServerCommand() Command
func NewMigrationCommand ¶
func NewMigrationCommand() Command
type CommandRunner ¶
type CommandRunner interface{}
type HTTPServerCommand ¶
type HTTPServerCommand struct{}
func (*HTTPServerCommand) Run ¶
func (s *HTTPServerCommand) Run(cmd *cobra.Command) CommandRunner
func (*HTTPServerCommand) Setup ¶
func (s *HTTPServerCommand) Setup(cmd *cobra.Command)
func (*HTTPServerCommand) Short ¶
func (s *HTTPServerCommand) Short() string
func (*HTTPServerCommand) Use ¶
func (s *HTTPServerCommand) Use() string
type MigrationCommand ¶
type MigrationCommand struct{}
func (MigrationCommand) Run ¶
func (m MigrationCommand) Run(cmd *cobra.Command) CommandRunner
func (MigrationCommand) Setup ¶
func (m MigrationCommand) Setup(cmd *cobra.Command)
func (MigrationCommand) Short ¶
func (m MigrationCommand) Short() string
func (MigrationCommand) Use ¶
func (m MigrationCommand) Use() string
type RabbitMQCommand ¶
type RabbitMQCommand struct{}
func NewRabbitMQCommand ¶
func NewRabbitMQCommand() *RabbitMQCommand
func (*RabbitMQCommand) Run ¶
func (s *RabbitMQCommand) Run(cmd *cobra.Command) CommandRunner
func (*RabbitMQCommand) Setup ¶
func (s *RabbitMQCommand) Setup(cmd *cobra.Command)
func (*RabbitMQCommand) Short ¶
func (s *RabbitMQCommand) Short() string
func (*RabbitMQCommand) Use ¶
func (s *RabbitMQCommand) Use() string
type RootCommand ¶
func NewRootCommand ¶
func NewRootCommand(assets *config.AssetsConfig) *RootCommand
func (RootCommand) Add ¶
func (r RootCommand) Add(command Command, boot func(runner CommandRunner))
Click to show internal directories.
Click to hide internal directories.