Documentation
¶
Overview ¶
Package commands provides modular CLI command packages for domain CLIs.
There are two ways to use commands from this package:
1. Via the Commands factory (recommended for most use cases):
commands := commands.New(lggr)
stateCmd, err := commands.State(domain, stateConfig)
if err != nil {
return err
}
app.AddCommand(stateCmd)
2. Via direct package imports (for advanced DI/testing):
import "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/commands/state"
cmd, err := state.NewCommand(state.Config{
Logger: lggr,
Domain: domain,
ViewState: myViewState,
Deps: state.Deps{...}, // inject mocks for testing
})
if err != nil {
return err
}
app.AddCommand(cmd)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commands ¶
type Commands struct {
// contains filtered or unexported fields
}
Commands provides a factory for creating CLI commands with shared configuration. This allows setting the logger once and reusing it across all commands.
func New ¶
New creates a new Commands factory with the given logger. The logger will be shared across all commands created by this factory.
type StateConfig ¶
type StateConfig struct {
// ViewState is the function that generates state from an environment.
// This is domain-specific and must be provided by the user.
ViewState state.ViewStateFunc
}
StateConfig holds configuration for state commands.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package datastore provides CLI commands for datastore management operations.
|
Package datastore provides CLI commands for datastore management operations. |
|
Package flags provides reusable flag helpers for CLI commands.
|
Package flags provides reusable flag helpers for CLI commands. |
|
Package state provides CLI commands for state management operations.
|
Package state provides CLI commands for state management operations. |
Click to show internal directories.
Click to hide internal directories.