Documentation ¶
Index ¶
- Variables
- func AddBaseCommands(cmd *cobra.Command, cli cli.Cli)
- func DisableFlagsInUseLine(cmd *cobra.Command)
- func ExitCode(err error) int
- func FlagErrorFunc(cmd *cobra.Command, err error) error
- func NewAgentCli(opts ...cli.AgentCliOption) *cli.AgentCli
- func NewConfigCommand(cli agentcli.Cli) *cobra.Command
- func NewDumpCommand(cli agentcli.Cli) *cobra.Command
- func NewGenerateCommand(cli agentcli.Cli) *cobra.Command
- func NewImportCommand(cli agentcli.Cli) *cobra.Command
- func NewKvdbCommand(cli agentcli.Cli) *cobra.Command
- func NewLogCommand(cli agentcli.Cli) *cobra.Command
- func NewMetricsCommand(cli agentcli.Cli) *cobra.Command
- func NewModelCommand(cli agentcli.Cli) *cobra.Command
- func NewReportCommand(cli agentcli.Cli) *cobra.Command
- func NewRootCommand(agentCli *cli.AgentCli) (*cobra.Command, error)
- func NewServiceCallCommand(cli agentcli.Cli) *cobra.Command
- func NewServiceCommand(cli agentcli.Cli) *cobra.Command
- func NewServiceListCommand(cli agentcli.Cli) *cobra.Command
- func NewStatusCommand(cli agentcli.Cli) *cobra.Command
- func NewValuesCommand(cli agentcli.Cli) *cobra.Command
- func NewVppCommand(cli agentcli.Cli) *cobra.Command
- func RunImport(cli agentcli.Cli, opts ImportOptions) error
- func RunLogList(cli agentcli.Cli, opts LogListOptions) error
- func RunLogSet(cli agentcli.Cli, opts LogSetOptions) error
- func SetupRootCommand(rootCmd *cobra.Command) (*cli.ClientOptions, *pflag.FlagSet, *cobra.Command)
- func ShowHelp(out io.Writer) func(*cobra.Command, []string) error
- func VisitAll(root *cobra.Command, fn func(*cobra.Command))
- type ConfigDeleteOptions
- type ConfigGetOptions
- type ConfigHistoryOptions
- type ConfigResyncOptions
- type ConfigRetrieveOptions
- type ConfigUpdateOptions
- type ConfigWatchOptions
- type DumpOptions
- type Errors
- type GenerateOptions
- type ImportOptions
- type LogListOptions
- type LogSetOptions
- type MetricsGetOptions
- type MetricsListOptions
- type ModelInspectOptions
- type ModelListOptions
- type ReportOptions
- type Root
- type ServiceCallOptions
- type ServiceListOptions
- type StatusError
- type StatusOptions
- type ValuesOptions
Constants ¶
This section is empty.
Variables ¶
var (
// RootName defines default name used for the root command.
RootName = "agentctl"
)
Functions ¶
func AddBaseCommands ¶
AddBaseCommands adds all base commands to cmd.
func DisableFlagsInUseLine ¶
DisableFlagsInUseLine sets the DisableFlagsInUseLine flag on all commands within the tree rooted at cmd.
func FlagErrorFunc ¶
FlagErrorFunc returns status error when err is not nil. It includes usage string and error message.
func NewAgentCli ¶
func NewAgentCli(opts ...cli.AgentCliOption) *cli.AgentCli
NewAgentCli creates new AgentCli with opts and configures log output to error stream.
func NewRootCommand ¶
NewRootCommand is helper for default initialization process for root command. Returs cobra command which is ready to be executed.
func RunLogList ¶
func RunLogList(cli agentcli.Cli, opts LogListOptions) error
func SetupRootCommand ¶
SetupRootCommand setups cobra command and returns CLI client options, flags and help command.
Types ¶
type ConfigDeleteOptions ¶ added in v3.2.0
type ConfigGetOptions ¶ added in v3.2.0
type ConfigHistoryOptions ¶ added in v3.2.0
type ConfigResyncOptions ¶ added in v3.2.0
type ConfigRetrieveOptions ¶ added in v3.2.0
type ConfigRetrieveOptions struct {
Format string
}
type ConfigUpdateOptions ¶ added in v3.2.0
type ConfigWatchOptions ¶ added in v3.3.0
type DumpOptions ¶
func (*DumpOptions) Validate ¶ added in v3.2.0
func (opts *DumpOptions) Validate() error
type Errors ¶
type Errors []error
Errors is a list of errors. Useful in a loop if you don't want to return the error right away and you want to display after the loop, all the errors that happened during the loop.
type GenerateOptions ¶
type ImportOptions ¶
type LogListOptions ¶
type LogListOptions struct {
Name string
}
type LogSetOptions ¶
type MetricsGetOptions ¶
type MetricsGetOptions struct {
Metrics []string
}
type MetricsListOptions ¶
type MetricsListOptions struct {
Refs []string
}
type ModelInspectOptions ¶
type ModelListOptions ¶
type ReportOptions ¶ added in v3.3.0
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root encapsulates a top-level cobra command (either agentctl or custom one).
func NewRootNamed ¶
NewRootNamed returns new Root named with name.
func (*Root) HandleGlobalFlags ¶
HandleGlobalFlags takes care of parsing global flags defined on the command, it returns the underlying cobra command and the args it will be called with (or an error).
On success the caller is responsible for calling Initialize() before calling `Execute` on the returned command.
func (*Root) Initialize ¶
func (root *Root) Initialize(ops ...cli.InitializeOpt) error
Initialize finalises global option parsing and initializes the agentctl client.
type ServiceCallOptions ¶
type ServiceListOptions ¶
type ServiceListOptions struct {
Methods bool
}
type StatusError ¶
StatusError reports an unsuccessful exit by a command.
func (StatusError) Error ¶
func (e StatusError) Error() string
func (StatusError) String ¶
func (e StatusError) String() string
type StatusOptions ¶
type StatusOptions struct {
Format string
}