utils

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpirationFromMap

func ExpirationFromMap(meta map[string]any) (time.Time, bool)

ExpirationFromMap extracts an expiration timestamp from a metadata map. It checks common expiry key names and nested "token"/"Token" objects for OAuth-style token representations.

func ParseBoolAny

func ParseBoolAny(val any) (bool, bool)

ParseBoolAny converts an arbitrary value to bool. Accepts bool, string ("true"/"false"/etc.), float64, and json.Number.

func ParseDurationAny

func ParseDurationAny(val any) (time.Duration, bool)

ParseDurationAny converts an arbitrary value to time.Duration. Accepts time.Duration, numeric nanoseconds, and duration strings like "10s".

func ParseIntAny

func ParseIntAny(val any) (int, bool)

ParseIntAny converts an arbitrary value to int. Accepts int, int32, int64, float64, json.Number, and string.

func ParseTimeValue

func ParseTimeValue(v any) (time.Time, bool)

ParseTimeValue converts an arbitrary value to time.Time. Accepts strings (RFC3339, Unix timestamp), float64, int64, and json.Number.

Types

This section is empty.

Jump to

Keyboard shortcuts

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