Documentation
¶
Overview ¶
Package util provides shared utility functions for the llm-router framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateID ¶
GenerateID returns a cryptographically secure 16-byte hex string (32 characters). Used for database record IDs across all services.
func GenerateToken ¶
GenerateToken returns a cryptographically secure 32-byte hex string (64 characters). Used for session tokens and router tokens that require higher entropy.
func HashSecret ¶
HashSecret produces a deterministic SHA-256 hex digest of a secret string. Used for storing hashed tokens in the database.
func Now ¶
Now returns the current time in UTC. Centralizes timestamp generation for consistency across the application.
func NowPtr ¶
NowPtr returns a pointer to the current UTC time. Useful for optional timestamp fields.
func Slugify ¶ added in v0.1.2
Slugify converts a name to a URL-safe slug, or "" when unusable. Single source of truth for slugs across providers, virtual models and plugin repositories; callers apply their own empty fallback.
func SlugifyOrDefault ¶ added in v0.4.0
SlugifyOrDefault slugifies a name, returning the fallback when unusable. Providers use it with the "provider" fallback so generated identifiers never read empty.
Types ¶
This section is empty.