rdb

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

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

Package rdb provides Redis-backed unique ID generation and bloom filter helpers.

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 BloomUnique

func BloomUnique(ctx context.Context, id string, latest []any) ([]any, error)

func BloomUniqueString

func BloomUniqueString(ctx context.Context, id, latest string) (bool, error)

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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