rdb

package
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package rdb provides a singleton Redis client with connection pool configuration.

Index

Constants

This section is empty.

Variables

View Source
var Client *redis.Client

Client is the singleton Redis client, provided by NewClient via fx.

Functions

func NewClient

func NewClient(lc fx.Lifecycle, _ *config.Type) (*redis.Client, error)

NewClient creates and returns a single Redis client configured from config.App.Redis. Connection pool parameters use go-redis defaults when set to zero, except ReadTimeout and WriteTimeout which fall back to 60s for backward compatibility.

func Shutdown

func Shutdown(ctx context.Context)

Shutdown gracefully closes the Redis client with a 5-second timeout. Client.Close is always called to release the connection pool, even when the ping fails (e.g. Redis is unreachable during shutdown).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL