Documentation
¶
Overview ¶
Package cloudrun provides automatic persistence backend selection for Cloud Run environments. It detects Cloud Run via K_SERVICE environment variable and attempts to use Datastore, falling back to local files if Datastore is unavailable or if not running in Cloud Run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a persistence layer optimized for Cloud Run environments. It automatically selects the best available backend:
- In Cloud Run (K_SERVICE env var set): tries Datastore, falls back to local files on error
- Outside Cloud Run: uses local files
The cacheID is used as the database name for Datastore or subdirectory for local files. This function always succeeds by falling back to local files if Datastore is unavailable.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.