MCPcopy
hub / github.com/appleboy/gin-jwt / EnableRedisStore

Method EnableRedisStore

auth_jwt_redis.go:61–74  ·  view source on GitHub ↗

EnableRedisStore enables Redis store with optional configuration

(opts ...RedisOption)

Source from the content-addressed store, hash-verified

59
60// EnableRedisStore enables Redis store with optional configuration
61func (mw *GinJWTMiddleware) EnableRedisStore(opts ...RedisOption) *GinJWTMiddleware {
62 mw.UseRedisStore = true
63
64 // Start with default config
65 config := store.DefaultRedisConfig()
66
67 // Apply all options
68 for _, opt := range opts {
69 opt(config)
70 }
71
72 mw.RedisConfig = config
73 return mw
74}
75
76// initializeRedisStore attempts to create and initialize Redis store
77// Falls back to in-memory store if Redis connection fails

Callers 6

createTestMiddlewareFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 1

DefaultRedisConfigFunction · 0.92