utils

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVArrayFlag

func CSVArrayFlag(cmd *cobra.Command, flag string, trimSpace bool) (results [][]string, err error)

func CSVFlag

func CSVFlag(cmd *cobra.Command, flag string) ([]string, error)

func Check

func Check(err error)

Checks if an error is present.

If it is present, it displays the error and exits with status 1.

If you want to display a custom message use CheckWithMessage.

func CheckWithMessage

func CheckWithMessage(err error, message string)

Checks if an error is present.

If it is present, it displays the provided message and exits with status 1.

func EditYamlInEditor

func EditYamlInEditor(objectName string, content string) (string, error)

func Exit

func Exit(code int)

func Fail

func Fail(message string)

func GetProjectId

func GetProjectId(name string) string

func InferProjectName

func InferProjectName() (string, error)

func ParseFileFlag

func ParseFileFlag(raw string) (string, string, error)

func ParseYamlResourceHeaders

func ParseYamlResourceHeaders(raw []byte) (string, string, error)

returns tuple (apiVersion, kind, error)

func RelativeAgeForHumans

func RelativeAgeForHumans(timestamp int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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