util

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const HOST_COLLECTORS_RUN_AS_ROOT_PROMPT = "Some host collectors need to be run as root.\nDo you want to exit and rerun the command using sudo?"

Variables

This section is empty.

Functions

func AppName

func AppName(name string) string

func Append added in v0.78.1

func Append[T any](target []T, src []T) []T

Append appends elements in src to target. We have this function because of how the builtin append() function works. It treats target nil slices the same as empty slices.

func EstimateNumberOfLines added in v0.69.2

func EstimateNumberOfLines(text string) int

func HomeDir

func HomeDir() string

func IsInCluster added in v0.79.0

func IsInCluster() bool

IsInCluster returns true if the code is running within a process inside a kubernetes pod

func IsRunningAsRoot added in v0.85.0

func IsRunningAsRoot() bool

func IsURL

func IsURL(str string) bool

func PromptYesNo added in v0.85.0

func PromptYesNo(question string) bool

func RenderTemplate added in v0.81.0

func RenderTemplate(tpl string, data interface{}) (string, error)

RenderTemplate renders a template and returns the result as a string

func SplitYAML

func SplitYAML(doc string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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