Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandConfig ¶
CommandConfig represents the configuration for creating a command
type CommandFactory ¶
type CommandFactory struct {
// contains filtered or unexported fields
}
CommandFactory handles the creation and configuration of cobra commands
func NewCommandFactory ¶
func NewCommandFactory(logger *observability.Logger) *CommandFactory
NewCommandFactory creates a new command factory
func (*CommandFactory) AddMiddleware ¶
func (f *CommandFactory) AddMiddleware(middleware CommandMiddleware)
AddMiddleware adds a middleware to the factory
func (*CommandFactory) CreateCommand ¶
func (f *CommandFactory) CreateCommand(cfg *CommandConfig) *cobra.Command
CreateCommand creates a new cobra command with the given configuration
type CommandMiddleware ¶
CommandMiddleware represents a function that wraps a command's execution
func ErrorHandlingMiddleware ¶
func ErrorHandlingMiddleware() CommandMiddleware
ErrorHandlingMiddleware adds structured error handling
func LoggingMiddleware ¶
func LoggingMiddleware(logger *observability.Logger) CommandMiddleware
LoggingMiddleware adds logging to command execution
func RecoveryMiddleware ¶
func RecoveryMiddleware(logger *observability.Logger) CommandMiddleware
RecoveryMiddleware adds panic recovery
Click to show internal directories.
Click to hide internal directories.