utils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SleepOrWait

func SleepOrWait(ctx context.Context, delay time.Duration, threshold time.Duration) error

SleepOrWait provides context-aware long waiting or short sleeping.

For delay <= threshold, it uses `time.Sleep` directly, ignoring context cancellation. For delay > threshold, it respects context cancellation.

func ValidateKey

func ValidateKey(key, keyType string) error

ValidateKey validates that a key meets the requirements: - Maximum 64 bytes length - Contains only alphanumeric ASCII characters, underscore (_), hyphen (-), colon (:), period (.), at (@), and plus (+)

func ValidateQuotaName

func ValidateQuotaName(name string) error

ValidateQuotaName validates a quota name with the same rules as keys

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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