util

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const JSON_EXTENSION = ".json"

Variables

This section is empty.

Functions

func GetDuration

func GetDuration(start time.Time, end time.Time) time.Duration

GetDuration returns the associated duration between two times

func GetIdentityOrFallback

func GetIdentityOrFallback(c *gin.Context, conf config.Identity) string

func GetSchemaNameFromRequest

func GetSchemaNameFromRequest(c *gin.Context, fallback string) string

func HttpHeadersToMap

func HttpHeadersToMap(c *gin.Context) map[string]interface{}

HttpHeadersToMap returns a map of http headers, but treats single-element headers as strings instead of slices of length 1

func MapUrlParams

func MapUrlParams(c *gin.Context, excludeParams ...string) map[string]interface{}

Coerce query params to a map[string]interface{}. Only use the first val of each key.

func Md5

func Md5(s string) string

func Pprint

func Pprint(i interface{}) string

func QueryToMap

func QueryToMap(v url.Values) map[string]interface{}

func Stringify

func Stringify(i interface{}) string

func StructToMap

func StructToMap(v interface{}) (map[string]interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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