helpers

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultErrorExitCode = 1

	DefaultWritePermissions = 0760
)

Variables

View Source
var ErrExit = fmt.Errorf("exit")

ErrExit may be passed to CheckError to instruct it to output nothing but exit with status code 1.

Functions

func BehaviorOnFatal

func BehaviorOnFatal(f func(string, int))

BehaviorOnFatal allows you to override the default behavior when a fatal error occurs, which is to call os.Exit(code). You can pass 'panic' as a function here if you prefer the panic() over os.Exit(1).

func CheckErr

func CheckErr(err error)

CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. Unrecognized errors will be printed with an "error: " prefix.

This method is generic to the command in use and may be used by non-Kubectl commands.

func DefaultBehaviorOnFatal

func DefaultBehaviorOnFatal()

DefaultBehaviorOnFatal allows you to undo any previous override. Useful in tests.

func GetZitiCtrlAdvertisedAddress

func GetZitiCtrlAdvertisedAddress() (string, error)

func GetZitiCtrlListenerAddress

func GetZitiCtrlListenerAddress() (string, error)

func GetZitiCtrlName

func GetZitiCtrlName() (string, error)

func GetZitiCtrlPort

func GetZitiCtrlPort() (string, error)

func GetZitiEdgeCtrlAdvertisedHostPort

func GetZitiEdgeCtrlAdvertisedHostPort() (string, error)

func GetZitiEdgeCtrlAdvertisedPort

func GetZitiEdgeCtrlAdvertisedPort() (string, error)

func GetZitiEdgeCtrlListenerHostPort

func GetZitiEdgeCtrlListenerHostPort() (string, error)

func GetZitiEdgeIdentityEnrollmentDuration

func GetZitiEdgeIdentityEnrollmentDuration() (time.Duration, error)

func GetZitiEdgeRouterEnrollmentDuration

func GetZitiEdgeRouterEnrollmentDuration() (time.Duration, error)

func GetZitiEdgeRouterListenerBindPort

func GetZitiEdgeRouterListenerBindPort() (string, error)

func GetZitiEdgeRouterPort

func GetZitiEdgeRouterPort() (string, error)

func GetZitiHome

func GetZitiHome() (string, error)

func HomeDir

func HomeDir() string

func JFrogAPIKey

func JFrogAPIKey() string

func NormalizePath

func NormalizePath(input string) string

NormalizePath replaces windows \ with / which windows allows for

func StandardErrorMessage

func StandardErrorMessage(err error) (string, bool)

StandardErrorMessage translates common errors into a human readable message, or returns false if the error is not one of the recognized types. It may also log extended information to glog.

This method is generic to the command in use and may be used by non-Kubectl commands.

func UsageError

func UsageError(cmd *cobra.Command, format string, args ...interface{}) error

func WorkingDir

func WorkingDir() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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