utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoticeColor  = "\033[0;38m%s\u001B[0m"
	PromptColor  = "\033[1;38m%s\u001B[0m"
	CyanColor    = "\033[0;36m%s\033[0m"
	MagentaColor = "\033[0;35m%s\033[0m"
)

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func Contains added in v0.0.7

func Contains(slice []string, str string) bool

func GetConfigFileLocation added in v0.0.7

func GetConfigFileLocation() string

func GetConfigs added in v0.0.7

func GetConfigs() []string

func GetCurrentConfigFile added in v0.0.7

func GetCurrentConfigFile() string

func GetEnv

func GetEnv(key, fallback string) string

func GetHomeDir

func GetHomeDir() string

func InitializeKubeconfig

func InitializeKubeconfig(kubeconfigPath string) (*api.Config, error)

func IsDirectoryExists added in v0.0.7

func IsDirectoryExists(path string) bool

func ListContexts

func ListContexts(kubeconfigPath string) []string

func ListNamespaces added in v0.1.0

func ListNamespaces(kubeconfigPath string) []string

func NewPromptUISearcher

func NewPromptUISearcher(items []string) list.Searcher

func SwitchContext

func SwitchContext(config *api.Config, contextName string, kubeconfigPath string) error

func SwitchNamespace added in v0.1.0

func SwitchNamespace(namespaceName string, kubeconfigPath string) error

func TouchFile

func TouchFile(name string) error

func WriteFile

func WriteFile(config, loc string)

Types

type BellSkipper

type BellSkipper struct{}

func (*BellSkipper) Close

func (bs *BellSkipper) Close() error

func (*BellSkipper) Write

func (bs *BellSkipper) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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