utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failed

func Failed(c *gin.Context, msg string)

func InitJobRuntimeObjectByKind

func InitJobRuntimeObjectByKind(kind string) client.Object

func IsKubedlManagedNamespace added in v0.4.2

func IsKubedlManagedNamespace(namespace *corev1.Namespace) bool

func Param

func Param(c *gin.Context, param string) string

Param gets space deduplicated param from URL.

func Query

func Query(c *gin.Context, param string) string

Query gets space deduplicated query from URL.

func Redirect403

func Redirect403(c *gin.Context)

func Redirect404

func Redirect404(c *gin.Context)

func Redirect500

func Redirect500(c *gin.Context)

func RequestWithHeader

func RequestWithHeader(method string, reqUrl string, header map[string]string, params map[string]string) (status int, body string, err error)

RequestWithHeader is a http client with header, url, and params

func RequestWithPost

func RequestWithPost(reqUrl string, header map[string]string, params map[string]string) (status int, body string, err error)

RequestWithPost is a http client with url, header and params

func RuntimeObjToMetaObj

func RuntimeObjToMetaObj(obj runtime.Object) (metaObj metav1.Object, ok bool)

func Succeed

func Succeed(c *gin.Context, obj interface{})

func TimeTransform

func TimeTransform(from, to string) (fromTime, toTime time.Time, err error)

TimeTransform transforms from-time and to-time from string to a Time instance formatted in RFC3339. Considering time differences between log-timestamp and job-timestamp, we shift 1h earlier for from-time and postpone 1h for to-time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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