utils

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SayFailed

func SayFailed()

func SayFailedMessage

func SayFailedMessage(format string, args ...interface{})

func SayMessage

func SayMessage(format string, args ...interface{})

func SayOK

func SayOK()

func SayWarningMessage

func SayWarningMessage(format string, args ...interface{})

Types

type ConnectionConfig

type ConnectionConfig struct {
	KubeCfgPath  string
	ClientConfig clientcmd.ClientConfig
	ClientSet    *kubernetes.Clientset
}

func (*ConnectionConfig) GetClientConfig

func (params *ConnectionConfig) GetClientConfig() (clientcmd.ClientConfig, error)

GetClientConfig gets ClientConfig from KubeCfgPath

func (*ConnectionConfig) Initialize

func (params *ConnectionConfig) Initialize() error

func (*ConnectionConfig) RestConfig

func (params *ConnectionConfig) RestConfig() (*rest.Config, error)

RestConfig returns REST config, which can be to use to create specific clientset

type Option

func WithCreatedAt

func WithCreatedAt(createdAt string) Option

func WithLastTransitionAt

func WithLastTransitionAt(lastTransitionAt string) Option

func WithReady

func WithReady(ready string) Option

func WithVerboseType

func WithVerboseType(verboseType string) Option

type PrintableResource

type PrintableResource struct {
	// contains filtered or unexported fields
}

func NewPrintableResource

func NewPrintableResource(level int, typeName, name string, options ...Option) *PrintableResource

func (*PrintableResource) AddConditions

func (res *PrintableResource) AddConditions(objectNode *ObjectNode, conditionInfos map[string][]ConditionInfo) error

func (*PrintableResource) AddKeyInfo

func (res *PrintableResource) AddKeyInfo(keyInfo []string, objectNode *ObjectNode) error

func (*PrintableResource) DumpResource

func (res *PrintableResource) DumpResource() [][]string

type PrintableTable

type PrintableTable struct {
	// contains filtered or unexported fields
}

func (*PrintableTable) Add

func (t *PrintableTable) Add(row []string)

func (*PrintableTable) AddMuitpleRows

func (t *PrintableTable) AddMuitpleRows(rows [][]string)

func (*PrintableTable) Print

func (t *PrintableTable) Print()

func (*PrintableTable) PrintDump

func (t *PrintableTable) PrintDump(wrapEnabled bool) []string

func (*PrintableTable) SetHeaderPrinted

func (t *PrintableTable) SetHeaderPrinted(headerPrinted bool)

func (*PrintableTable) SetSeperator

func (t *PrintableTable) SetSeperator(required bool)

type Table

type Table interface {
	Add(row []string)
	AddMuitpleRows(rows [][]string)
	Print()
	PrintDump(wrapEnabled bool) []string
	SetSeperator(bool)
	SetHeaderPrinted(bool)
}

func NewTable

func NewTable(w io.Writer, headers []string) Table

Jump to

Keyboard shortcuts

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