Documentation
¶
Index ¶
- Constants
- Variables
- func Module(extends ...di.Node) di.Node
- func NewServiceController() (*systemServiceController, error)
- func RegisterCommands(params registerParams) error
- func Run(nodes ...di.Node) di.Node
- func Use(name string, nodes ...di.Node) di.Node
- func UseBasicCommands() di.Node
- func UseServiceCommands() di.Node
- func UseServiceController() di.Node
- func UseServiceRuntime() di.Node
- func WithDefaultName(name string) di.Node
- type Commander
- type HealthcheckCommand
- type HelpCommand
- type PostRunner
- type PreRunner
- type Root
- type ServiceCommand
- type ServiceController
- type ServiceStatusController
- type VersionCommand
Constants ¶
View Source
const CommandersGroupName = "us/cmd/commanders"
View Source
const PostRunnersGroupName = "us/cmd/post_runners"
View Source
const PreRunnersGroupName = "us/cmd/pre_runners"
Variables ¶
View Source
var ErrServiceControllerNotConfigured = errors.New("service controller is not configured")
View Source
var ErrServiceStatusNotSupported = errors.New("service status is not supported by controller")
Functions ¶
func Module ¶
Module wires root command creation and auto-registration for all Commander implementations.
func NewServiceController ¶ added in v1.13.0
func NewServiceController() (*systemServiceController, error)
func RegisterCommands ¶
func RegisterCommands(params registerParams) error
func Run ¶ added in v1.12.0
Serve is simply an alias for Use("serve", ...) This is the default command that is run when no command is provided.
func Use ¶
Use conditionally includes nodes for the selected CLI command. Selection is inferred from process args (defaults to "serve" when no command is provided). Nested commands are supported via prefix matching, for example: Use("user") matches "user list", and Use("user list") matches "user list active".
func UseBasicCommands ¶
func UseServiceCommands ¶ added in v1.13.0
func UseServiceController ¶ added in v1.13.0
func UseServiceRuntime ¶ added in v1.13.0
func WithDefaultName ¶
WithDefaultName configures the default command used when no subcommand is provided.
Types ¶
type HealthcheckCommand ¶ added in v1.6.0
type HealthcheckCommand struct {
// contains filtered or unexported fields
}
func NewHealthcheckCommand ¶ added in v1.6.0
func NewHealthcheckCommand(shutdowner fx.Shutdowner) *HealthcheckCommand
func (*HealthcheckCommand) Command ¶ added in v1.6.0
func (s *HealthcheckCommand) Command() *cobra.Command
type HelpCommand ¶
type HelpCommand struct {
// contains filtered or unexported fields
}
func NewHelpCommand ¶
func NewHelpCommand(shutdowner fx.Shutdowner) *HelpCommand
func (*HelpCommand) Command ¶
func (s *HelpCommand) Command() *cobra.Command
type PostRunner ¶ added in v1.13.0
type PreRunner ¶ added in v1.13.0
func NewServiceRuntimeHook ¶ added in v1.13.0
func NewServiceRuntimeHook(shutdowner fx.Shutdowner, log *zap.Logger) PreRunner
type Root ¶
func (*Root) RegisterOne ¶
type ServiceCommand ¶ added in v1.13.0
type ServiceCommand struct {
// contains filtered or unexported fields
}
func NewServiceCommand ¶ added in v1.13.0
func NewServiceCommand(in serviceCommandParams) *ServiceCommand
func (*ServiceCommand) Command ¶ added in v1.13.0
func (s *ServiceCommand) Command() *cobra.Command
type ServiceController ¶ added in v1.13.0
type ServiceStatusController ¶ added in v1.13.0
type VersionCommand ¶
type VersionCommand struct {
// contains filtered or unexported fields
}
func NewVersionCommand ¶
func NewVersionCommand(shutdowner fx.Shutdowner) *VersionCommand
func (*VersionCommand) Command ¶
func (s *VersionCommand) Command() *cobra.Command
Click to show internal directories.
Click to hide internal directories.