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