util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterOutput

func FilterOutput(lines []string, search string, stripHeader bool) []string

func GetClientset

func GetClientset(kubeconfig string) *kubernetes.Clientset

func GetDeploymentList added in v1.0.1

func GetDeploymentList(namespace string, context string, labels string) appsv1.DeploymentList

func GetMatchingPods

func GetMatchingPods(service string, namespace string, context string, labels string) []string

func GetNodeList added in v1.0.1

func GetNodeList(context string, labels string) corev1.NodeList

func GetNodes added in v1.0.1

func GetNodes(namespace string, context string, labels string) []string

func GetPodList added in v1.0.1

func GetPodList(namespace string, context string, labels string) corev1.PodList

func GetPodListAllNamespaces added in v1.0.2

func GetPodListAllNamespaces(context string, labels string) corev1.PodList

func GetPodPrompt added in v0.3.0

func GetPodPrompt(podInfos []PodInfo, helpMessage string) promptui.Select

func GetPods

func GetPods(namespace string, context string, labels string) []string

func GetServiceList added in v1.0.1

func GetServiceList(namespace string, context string, labels string) corev1.ServiceList

func GetServicePods

func GetServicePods(service string, namespace string, context string, labels string) []string

func InteractiveCommand

func InteractiveCommand(name string, args ...string)

func K8sCommandArgs

func K8sCommandArgs(args []string, namespace string, context string, labels string) []string

func KeysString added in v0.2.1

func KeysString(m map[string]string) string

func RawK8sOutput

func RawK8sOutput(namespace string, context string, labels string, args ...string) []string

func RawK8sOutputString added in v1.0.1

func RawK8sOutputString(namespace string, context string, labels string, args ...string) string

func RunCommand

func RunCommand(name string, args ...string) []string

func StreamCommand

func StreamCommand(c chan string, prefix string, name string, args ...string)

Types

type Age added in v0.1.2

type Age struct {
	Time time.Time
}

func (*Age) Relative added in v0.1.2

func (a *Age) Relative() string

type ColorManager

type ColorManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ColorManager) Colorize

func (cm *ColorManager) Colorize(s string) string

func (*ColorManager) GetColor

func (cm *ColorManager) GetColor() color.Attribute

func (*ColorManager) GetPrefix

func (cm *ColorManager) GetPrefix(prefix string) string

type OutputManager

type OutputManager struct {
	sync.RWMutex

	HeaderColumns []string
	// contains filtered or unexported fields
}

func (*OutputManager) Append

func (o *OutputManager) Append(s ...string)

func (*OutputManager) FormattedStringSlice added in v0.2.1

func (o *OutputManager) FormattedStringSlice() []string

func (*OutputManager) GetOutput

func (o *OutputManager) GetOutput() []string

func (*OutputManager) HeaderLine added in v0.2.1

func (o *OutputManager) HeaderLine() string

func (*OutputManager) Print

func (o *OutputManager) Print()

type PodInfo added in v0.3.0

type PodInfo struct {
	Name     string
	Ready    string
	Status   string
	Restarts string
	Age      string
}

func CreatePodInfos added in v0.3.0

func CreatePodInfos(pods []string) []PodInfo

func (PodInfo) Print added in v0.3.0

func (p PodInfo) Print() string

Jump to

Keyboard shortcuts

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