redisx

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 4 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 {
	Rdb    *redis.Client
	Prefix string
}

func New

func New(cfg Config, opts ...Option) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Key

func (c *Client) Key(parts ...string) string

func (*Client) Ping

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

type Config

type Config struct {
	Addr     string `mapstructure:"addr" yaml:"addr"`
	Username string `mapstructure:"username" yaml:"username"`
	Password string `mapstructure:"password" yaml:"password"`
	DB       int    `mapstructure:"db" yaml:"db"`

	Prefix string `mapstructure:"prefix" yaml:"prefix"`

	PoolSize     int `mapstructure:"pool_size" yaml:"pool_size"`
	MinIdleConns int `mapstructure:"min_idle_conns" yaml:"min_idle_conns"`
}

type Option

type Option func(*options)

func WithHooks

func WithHooks(hooks ...redis.Hook) Option

Jump to

Keyboard shortcuts

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