utils

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDurationOrDefault added in v1.57.0

func CacheDurationOrDefault(d, fallback time.Duration) time.Duration

CacheDurationOrDefault returns d, or fallback if d is non-positive.

func GenerateRandomString

func GenerateRandomString(length int) (string, error)

func StaticCacheControlValue added in v1.57.0

func StaticCacheControlValue(maxAge time.Duration) string

StaticCacheControlValue returns a Cache-Control value appropriate for a static, publicly cacheable document (JWKS, discovery metadata) that changes rarely enough to always require revalidation rather than a shorter max-age.

func ValidateRequestBody

func ValidateRequestBody(w http.ResponseWriter, r *http.Request) bool

func WriteJsonResponse

func WriteJsonResponse(w http.ResponseWriter, status int, data interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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