Documentation
¶
Index ¶
- Constants
- Variables
- func ExitOnErr(log *logrus.Logger, err error)
- func ExportData(format string, outputFile *string, renderer model.Renderer) error
- func ExportDataCommand(ctx *cli.Context, renderer model.Renderer) error
- func GetClient(ctx *cli.Context) *chClient.Client
- func GetConfig(ctx *cli.Context) model.Config
- func GetConfigPath(ctx *cli.Context) string
- func GetFirstClientNamespace(ctx *cli.Context) (string, error)
- func GetNamespace(ctx *cli.Context) string
- func GetTokens(ctx *cli.Context) model.Tokens
- func GetVersion(ctx *cli.Context) semver.Version
- func LoadConfig(configFilePath string, config *model.Config) error
- func LoadTokens(ctx *cli.Context) (model.Tokens, error)
- func LogFileName() string
- func SaveConfig(ctx *cli.Context) error
- func SaveTokens(ctx *cli.Context, tokens model.Tokens) error
- func SetClient(ctx *cli.Context, client *chClient.Client)
- func SetConfig(ctx *cli.Context, config model.Config)
- func SetTokens(ctx *cli.Context, tokens model.Tokens)
- func StoreClient(ctx *cli.Context, client *chClient.Client)
- func WriteConfig(ctx *cli.Context) error
- type Set
Constants ¶
View Source
const ( JSON = "json" YAML = "yaml" )
View Source
const (
ErrNoNamespaces chkitErrors.Err = "no namespaces in account"
)
View Source
const ( // ErrUnableToSaveConfig -- unable to save config ErrUnableToSaveConfig chkitErrors.Err = "unable to save config" )
Variables ¶
View Source
var DeleteFlags = []cli.Flag{ NamespaceFlag, }
View Source
var GetFlags = []cli.Flag{ &cli.StringFlag{ Name: "file", Usage: "file to write output", Aliases: []string{"f"}, }, &cli.StringFlag{ Name: "output", Usage: "define output formats: yaml, json", Aliases: []string{"o"}, }, NamespaceFlag, }
View Source
var NamespaceFlag = &cli.StringFlag{ Name: "namespace", Aliases: []string{"n", "ns"}, Usage: "namespace to use", }
Functions ¶
func GetConfigPath ¶
GetConfigPath -- exctract config path from Context
func GetFirstClientNamespace ¶
GetFirstClientNamespace -- fetches namespace list and returns first element. Needed for login.
func GetNamespace ¶
GetNamespace -- return namespace for usage in commands. Priority: "namespace" flag, config file.
func LoadConfig ¶
LoadConfig -- loads config from fs
func LoadTokens ¶
LoadTokens -- loads tokens from fs
func LogFileName ¶
func LogFileName() string
func SaveConfig ¶
SaveConfig -- writes config in config path
func SaveTokens ¶
SaveTokens -- save tokens in config path
func StoreClient ¶
func WriteConfig ¶
WriteConfig -- writes config from Context to config dir
Types ¶
Click to show internal directories.
Click to hide internal directories.