helper

package
v0.12.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtLeastOneViperBoolFlagGiven

func AtLeastOneViperBoolFlagGiven(flags ...string) bool

AtLeastOneViperBoolFlagGiven ensure at least one bool flag is given

func AtLeastOneViperInt64FlagGiven

func AtLeastOneViperInt64FlagGiven(flags ...string) bool

AtLeastOneViperInt64FlagGiven ensure at least one int64 flag is given

func AtLeastOneViperStringFlagGiven

func AtLeastOneViperStringFlagGiven(flags ...string) bool

AtLeastOneViperStringFlagGiven ensure at least one string flag is given

func AtLeastOneViperStringSliceFlagGiven

func AtLeastOneViperStringSliceFlagGiven(flags ...string) bool

AtLeastOneViperStringSliceFlagGiven ensure at least one string slice flag is given

func ClientNoAuth added in v0.12.11

func ClientNoAuth() runtime.ClientAuthInfoWriterFunc

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

func HumanizeDuration(duration time.Duration) string

HumanizeDuration format given duration human readable

func HumanizeSize added in v0.9.5

func HumanizeSize(b int64) string

func LabelsToMap added in v0.9.5

func LabelsToMap(labels []string) (map[string]string, error)

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 Prompt

func Prompt(msg, compare string) error

Prompt the user to given compare text

func ReadFrom

func ReadFrom(from string, data interface{}, f func(target interface{})) error

ReadFrom will either read from stdin (-) or a file path an marshall from yaml to data

func Truncate

func Truncate(input, elipsis string, maxlength int) string

Truncate will trim a string in the middle and replace it with elipsis FIXME write a test

func ViperBool

func ViperBool(flag string) *bool

ViperBool returns the bool pointer for the given flag

func ViperInt64

func ViperInt64(flag string) *int64

ViperInt64 returns the int64 pointer for the given flag

func ViperString

func ViperString(flag string) *string

ViperString returns the string pointer for the given flag

func ViperStringSlice

func ViperStringSlice(flag string) []string

ViperStringSlice returns the string slice for the given flag

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL