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 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 NewModelCommand(cli agentcli.Cli) *cobra.Command
- func NewRootCommand(agentCli *cli.AgentCli) (*cobra.Command, error)
- 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 DumpOptions
- type Errors
- type GenerateOptions
- type ImportOptions
- type LogListOptions
- type LogSetOptions
- type ModelInspectOptions
- type ModelListOptions
- type Root
- 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 DumpOptions ¶
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 ModelInspectOptions ¶
type ModelListOptions ¶
type ModelListOptions struct {
Refs []string
}
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 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
}
type ValuesOptions ¶
type ValuesOptions struct {
Models []string
}