utils

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvGetBool

func EnvGetBool(key string, defaultValue bool) bool

func EnvGetDuration

func EnvGetDuration(key string, defaultValue time.Duration) time.Duration

func EnvGetInt

func EnvGetInt(key string, defaultValue int) int

func HttpGetDispositionFilename

func HttpGetDispositionFilename(disposition string) (string, error)

HttpGetDispositionFilename parses value of "Content-Disposition" header e.g., extract "abc.zip" from "attachment; filename=abc.zip"

func HttpResponseError

func HttpResponseError(rw http.ResponseWriter, statusCode int, err error)

func HttpResponseErrorMsg

func HttpResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string)

func HttpResponseOKWithBody

func HttpResponseOKWithBody(rw http.ResponseWriter, obj interface{})

func HttpResponseStatus

func HttpResponseStatus(rw http.ResponseWriter, statusCode int)

func Now

func Now() string

func PodNamespace

func PodNamespace() string

Get the namespace that the Pod is running in.

func UnzipSupportBundle added in v0.0.9

func UnzipSupportBundle(bundleZipFile, destination string) (err error)

UnzipSupportBundle is a helper method to make it easier to unzip the contents of the sample support bundle for tests

func WriteStdout

func WriteStdout(msg string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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