util

package
v0.0.0-...-1c44903 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeApplicationJSON = "application/json"
	HeaderContentType          = "Content-Type"
)

Variables

This section is empty.

Functions

func BoolFromPtr

func BoolFromPtr(val *bool) bool

func BoolPtr

func BoolPtr(b bool) *bool

func Close

func Close(closer io.ReadCloser)

func DecodeJson

func DecodeJson(jsonConfig string, target interface{}) error

func EncodeJson

func EncodeJson(state interface{}) (string, error)

func IntOrStrPtr

func IntOrStrPtr(intOrStr intstr.IntOrString) *intstr.IntOrString

func IntPtr

func IntPtr(val int) *int

func RemoveNotAllowedCharacters

func RemoveNotAllowedCharacters(str string) string

RemoveNotAllowedCharacters returns string containing only alphanumeric characters or hyphens

func RespondWithError

func RespondWithError(w http.ResponseWriter, status int, err error)

func Retry

func Retry(interval time.Duration, count int, operation func() error) error

func StartWithLetter

func StartWithLetter(str string) string

StartWithLetter returns given string but starting with letter

func StringPtr

func StringPtr(str string) *string

func TimePtr

func TimePtr(time time.Time) *time.Time

func UnwrapInt

func UnwrapInt(intPtr *int) int

func UnwrapStr

func UnwrapStr(strPtr *string) string

func WaitForFunction

func WaitForFunction(interval time.Duration, timeout time.Duration, isReady func() (bool, error)) error

Types

type Error

type Error struct {
	Message string `json:"message"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

Directories

Path Synopsis
k8s

Jump to

Keyboard shortcuts

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