Documentation
¶
Overview ¶
Package cmdutil provides utilities for working with cobra commands
Index ¶
Constants ¶
View Source
const ( SpinnerInterval = 100 * time.Millisecond SpinnerColor = "green" )
Variables ¶
View Source
var ( SpinnerCharSet = spinner.CharSets[78] SuccessIcon = color.GreenString("✔") )
Functions ¶
func DisableAuthCheck ¶
func IsAuthCheckEnabled ¶
Types ¶
type Factory ¶
type Factory struct {
Log *zap.SugaredLogger // logger
Printer printer.Printer // printer
Config config.Config // config(flag, env, file)
ApiClient api.Client // query api
AuthClient auth.Client // login, refresh token
Prompter prompt.Prompter // interactive prompter
Selector selector.Selector // interactive selector
ParamFiller fill.ParamFiller // fill params
PersistentFlags
}
Factory is a factory for command runners It is used to pass common dependencies to commands. It is kind of like a "context" for commands.
type PersistentFlags ¶
type PersistentFlags struct {
Debug bool // debug mode, default false
Interactive bool // interactive mode, default true
AutoRefreshToken bool // auto refresh token, default true, only when token is from browser(OAuth2)
AutoCheckUpdate bool // auto check update, default true
}
PersistentFlags are flags that are common to all commands
Click to show internal directories.
Click to hide internal directories.