Upstash Redis
If you enable Redis cache during gofire setup, cfg.RedisEnabled becomes true and you can use the cache package.
Usage
import "github.com/messivite/goFire/cache"
if cfg.RedisEnabled {
c, _ := cache.NewUpstashCache(cfg.UpstashRedisRestURL, cfg.UpstashRedisRestToken, "myapp:")
// Inject into handlers or services
}
// In handler: c.Get(ctx, key), c.SetAsync(ctx, key, data, ttlSeconds)
Environment variables
UPSTASH_REDIS_REST_URL– e.g. https://your-db.upstash.ioUPSTASH_REDIS_REST_TOKEN