Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "vef:redis", fx.Provide( fx.Annotate( NewClient, fx.OnStart(func(ctx context.Context, client *redis.Client) error { if client == nil { return nil } if err := client.Ping(ctx).Err(); err != nil { return fmt.Errorf("failed to connect to redis: %w", err) } return logRedisServerInfo(ctx, client) }), fx.OnStop(func(client *redis.Client) error { if client == nil { return nil } logger.Info("Closing Redis client...") return client.Close() }), ), ), )
Module provides Redis client functionality with automatic lifecycle management. When vef.redis.enabled=false the constructor returns nil; the lifecycle hooks guard against that so applications without Redis can still load the module without paying the connection penalty.
Functions ¶
func HealthCheck ¶
HealthCheck verifies Redis availability for monitoring endpoints.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.