Documentation ¶
Index ¶
- func AtLeastOneViperBoolFlagGiven(flags ...string) bool
- func AtLeastOneViperInt64FlagGiven(flags ...string) bool
- func AtLeastOneViperStringFlagGiven(flags ...string) bool
- func AtLeastOneViperStringSliceFlagGiven(flags ...string) bool
- func Edit(id string, getFunc func(id string) ([]byte, error), ...) error
- func EnrichKubeconfigTpl(tpl string, authContext *auth.AuthContext) ([]byte, error)
- func HumanizeDuration(duration time.Duration) string
- func HumanizeSize(b int64) string
- func LabelsToMap(labels []string) (map[string]string, error)
- func MergeKubeconfigTpl(currentCfg map[interface{}]interface{}, tpl, contextName, clusterName string, ...) ([]byte, error)
- func MustPrintKubernetesResource(in any)
- func Prompt(msg, compare string) error
- func ReadFrom(from string, data interface{}, f func(target interface{})) error
- func Truncate(input, elipsis string, maxlength int) string
- func ViperBool(flag string) *bool
- func ViperInt64(flag string) *int64
- func ViperString(flag string) *string
- func ViperStringSlice(flag string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtLeastOneViperBoolFlagGiven ¶
AtLeastOneViperBoolFlagGiven ensure at least one bool flag is given
func AtLeastOneViperInt64FlagGiven ¶
AtLeastOneViperInt64FlagGiven ensure at least one int64 flag is given
func AtLeastOneViperStringFlagGiven ¶
AtLeastOneViperStringFlagGiven ensure at least one string flag is given
func AtLeastOneViperStringSliceFlagGiven ¶
AtLeastOneViperStringSliceFlagGiven ensure at least one string slice flag is given
func Edit ¶
func Edit(id string, getFunc func(id string) ([]byte, error), updateFunc func(filename string) error) error
Edit a yaml response from getFunc in place and call updateFunc after save
func EnrichKubeconfigTpl ¶ added in v0.9.7
func EnrichKubeconfigTpl(tpl string, authContext *auth.AuthContext) ([]byte, error)
func HumanizeDuration ¶
HumanizeDuration format given duration human readable
func HumanizeSize ¶ added in v0.9.5
func MergeKubeconfigTpl ¶ added in v0.10.0
func MergeKubeconfigTpl(currentCfg map[interface{}]interface{}, tpl, contextName, clusterName string, authContext *auth.AuthContext) ([]byte, error)
func MustPrintKubernetesResource ¶ added in v0.10.0
func MustPrintKubernetesResource(in any)
func ReadFrom ¶
ReadFrom will either read from stdin (-) or a file path an marshall from yaml to data
func Truncate ¶
Truncate will trim a string in the middle and replace it with elipsis FIXME write a test
func ViperInt64 ¶
ViperInt64 returns the int64 pointer for the given flag
func ViperString ¶
ViperString returns the string pointer for the given flag
func ViperStringSlice ¶
ViperStringSlice returns the string slice for the given flag
Types ¶
This section is empty.