redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package redis provides a Redis client wrapper for the scheduler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the go-redis client with additional functionality.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new Redis client.

func (*Client) Close

func (c *Client) Close() error

Close closes the Redis connection.

func (*Client) GetRedisAddr

func (c *Client) GetRedisAddr() string

GetRedisAddr returns the Redis address for Asynq client configuration.

func (*Client) GetRedisDB

func (c *Client) GetRedisDB() int

GetRedisDB returns the Redis database number for Asynq client configuration.

func (*Client) GetRedisPassword

func (c *Client) GetRedisPassword() string

GetRedisPassword returns the Redis password for Asynq client configuration.

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health performs a health check on the Redis connection.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Ping verifies the Redis connection is alive.

func (*Client) RedisClient

func (c *Client) RedisClient() *redis.Client

RedisClient returns the underlying go-redis client for direct access.

type Config

type Config struct {
	Addr         string
	Password     string
	DB           int
	PoolSize     int
	MinIdleConns int
	MaxRetries   int
	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

Config holds Redis connection configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults.

Jump to

Keyboard shortcuts

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