utils

package
v0.0.0-...-7febb3a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, cmd ...*cobra.Command)

func GetKubeMQClient

func GetKubeMQClient(ctx context.Context, cfg *config.Config) (*kubemq.Client, error)

func Print

func Print(msg string)

func PrintAndExit

func PrintAndExit(msg string)

func Printf

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

func PrintfAndExit

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

func Println

func Println(msg string)

func Printlnf

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

func PrintlnfNoTitle

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

func Run

func Run(ctx context.Context, cfg *config.Config, resources []string, include []string, exclude []string) error

func TabbedString

func TabbedString(f func(io.Writer) error) (string, error)

func Title

func Title(input string) string

Types

type Message

type Message struct {
	Resource string
	Message  string
}

type PrefixWriter

type PrefixWriter interface {
	// Write writes text with the specified indentation level.
	Write(level int, format string, a ...interface{})
	// WriteLine writes an entire line with no indentation level.
	WriteLine(a ...interface{})
	// Flush forces indentation to be reset.
	Flush()
}

PrefixWriter can write text at various indentation levels.

func NewPrefixWriter

func NewPrefixWriter(out io.Writer) PrefixWriter

NewPrefixWriter creates a new PrefixWriter.

Jump to

Keyboard shortcuts

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