robot_redis

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package robot_redis 提供 Redis 连接抽象,支持集群与非集群模式。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFlags

func RegisterFlags(flagSet *flag.FlagSet) *flag.FlagSet

Types

type Config

type Config struct {
	Addrs       []string `yaml:"addrs"`        // Redis 地址列表(非集群只取第一个)
	Password    string   `yaml:"password"`     // 密码
	ClusterMode bool     `yaml:"cluster_mode"` // 是否集群模式
}

Config Redis 连接配置

func ParseConfig

func ParseConfig(flagSet *flag.FlagSet) Config

type RedisClient

统一的 Redis 客户端抽象

func NewClient

func NewClient(cfg Config) (RedisClient, error)

NewClient 根据配置创建 Redis 客户端并进行 Ping 检测。

Jump to

Keyboard shortcuts

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