util

package
v0.0.0-...-185b600 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DaemonsetHeader       = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tUP-TO-DATE\tAVAILABLE\tNODE SELECTOR\tAGE"
	DaemonsetHeaderWide   = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tUP-TO-DATE\tAVAILABLE\tNODE SELECTOR\tAGE\tCONTAINERS\tIMAGES\tSELECTOR"
	DeploymentHeader      = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tUP-TO-DATE\tAVAILABLE\tAGE"
	DeploymentHeaderWide  = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tUP-TO-DATE\tAVAILABLE\tAGE\tCONTAINERS\tIMAGES"
	HpaHeader             = "NAMESPACE\tNAME\tREFERENCE\tTARGETS\tMINPODS\tMAXPODS\tREPLICAS\tAGE"
	NodeHeader            = "NAME\tSTATUS\tROLES\tAGE\tVERSION"
	NodeHeaderWide        = "NAME\tSTATUS\tROLES\tAGE\tVERSION\tINTERNAL-IP\tEXTERNAL-IP\tOS-IMAGE\tKERNEL-VERSION\tCONTAINER-RUNTIME"
	PodHeader             = "NAMESPACE\tNAME\tREADY\tSTATUS\tRESTART\tAGE"
	PodHeaderWide         = "NAMESPACE\tNAME\tREADY\tSTATUS\tRESTART\tAGE\tIP\tNODENAME"
	StatefulsetHeader     = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tAGE"
	StatefulsetHeaderWide = "NAMESPACE\tNAME\tDESIRED\tCURRENT\tAGE\tCONTAINERS\tIMAGES"
	ConfigMapHeader       = "NAMESPACE\tNAME\tDATA\tAGE"
	SecretHeader          = "NAMESPACE\tNAME\tTYPE\tDATA\tAGE"
	ServiceHeader         = "NAMESPACE\tNAME\tREADY\tSTATUS\tRESTARTS\tAGE"

	DaemonsetRowTemplate       = "%s\t%s\t%d\t%d\t%d\t%d\t%s\t%s"
	DaemonsetRowTemplateWide   = "%s\t%s\t%d\t%d\t%d\t%d\t%s\t%s\t%s\t%s\t%s"
	DeploymentRowTemplate      = "%s\t%s\t%d\t%d\t%d\t%d\t%s"
	DeploymentRowTemplateWide  = "%s\t%s\t%d\t%d\t%d\t%d\t%s\t%s\t%s"
	HpaRowTemplate             = "%s\t%s\t%s/%s\t%d%%/%d%%\t%d\t%d\t%d\t%s"
	NodeRowTemplate            = "%s\t%s\t%s\t%s\t%s"
	NodeRowTemplateWide        = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"
	PodRowTemplate             = "%s\t%s\t%d/%d\t%s\t%d\t%s"
	PodRowTemplateWide         = "%s\t%s\t%d/%d\t%s\t%d\t%s\t%s\t%s"
	StatefulsetRowTemplate     = "%s\t%s\t%d\t%d\t%s"
	StatefulsetRowTemplateWide = "%s\t%s\t%d\t%d\t%s\t%s\t%s"
	ConfigMapRowTemplate       = "%s\t%s\t%d\t%s"
	SecretRowTemplate          = "%s\t%s\t%s\t%d\t%s"
	ServiceRowTemplate         = "%s\t%s\t%d/%d\t%s\t%d\t%s"
)

Variables

This section is empty.

Functions

func ConfigMapList

func ConfigMapList(opt *options.SearchOptions) *corev1.ConfigMapList

ConfigMapList - return a list of ConfigMap(s)

func DaemonsetList

func DaemonsetList(opt *options.SearchOptions) *appsv1.DaemonSetList

DaemonsetList - return a list of DaemonSet(s)

func DeploymentList

func DeploymentList(opt *options.SearchOptions) *appsv1.DeploymentList

DeploymentList - return a list of Deployment(s)

func GetAge

func GetAge(d time.Duration) string

GetAge - return human readable time expression

func GetDefaultNamespace

func GetDefaultNamespace() string

func K8sCommandArgs

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

func KeysString

func KeysString(m map[string]string) string

func NodeList

func NodeList(opt *options.SearchOptions) *corev1.NodeList

NodeList - return a list of Node(s)

func PodList

func PodList(opt *options.SearchOptions) *corev1.PodList

PodList - return a list of Pod(s)

func RawK8sOutput

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

func RunCommand

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

func SecretList

func SecretList(opt *options.SearchOptions) *corev1.SecretList

SecretList - return a list of Secret(s)

func ServiceList

func ServiceList(opt *options.SearchOptions) *corev1.ServiceList

func SetOptions

func SetOptions(opt *options.SearchOptions) (string, *metav1.ListOptions)

setOptions - set common options for clientset

func StatefulSetList

func StatefulSetList(opt *options.SearchOptions) *appsv1.StatefulSetList

StatefulSetList - return a list of StatefulSets

func TrimQuoteAndSpace

func TrimQuoteAndSpace(input string) string

TrimQuoteAndSpace - remove Spaces, Tabs, SingleQuotes, DoubleQuites

Types

type Age

type Age struct {
	Time time.Time
}

func (*Age) Relative

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

Jump to

Keyboard shortcuts

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