redis

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*redis.Client
	Conf Config
}

func (*Client) Close

func (db *Client) Close() error

Close disconnects the Redis client and shuts down the OTel instance if enabled.

func (*Client) Config

func (db *Client) Config() any

Config returns the embedded Conf as the configuration for injection.

func (*Client) Init

func (db *Client) Init() error

Init calls Build to create and connect the Redis client.

type Config

type Config struct {
	redis.Options
	Otel     redisotel.Config
	CertFile string `json:"cert_file,omitempty"`
	KeyFile  string `json:"key_file,omitempty"`
}

func (*Config) AfterInject

func (c *Config) AfterInject()

AfterInject loads TLS certificates when both CertFile and KeyFile are set.

func (*Config) BeforeInject

func (c *Config) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*Config) Build

func (c *Config) Build() (*redis.Client, error)

Build creates a Redis client and verifies connectivity with a PING.

Jump to

Keyboard shortcuts

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