redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchemeRedis represents Redis URI scheme
	SchemeRedis reader.Scheme = "redis"
	// SchemeRediss represents Redis SSL URI scheme
	SchemeRediss reader.Scheme = "rediss"
)

Variables

View Source
var (
	// DefaultTimeout for Redis operations
	DefaultTimeout = 30 * time.Second
	// DefaultRetryAttempts for failed operations
	DefaultRetryAttempts = 3
	// DefaultRetryDelay between retry attempts
	DefaultRetryDelay = 1 * time.Second
	// DefaultDB is the default Redis database
	DefaultDB = 0
)

Functions

This section is empty.

Types

type RedisConfig

type RedisConfig struct {
	Addr         string
	Password     string
	DB           int
	Key          string
	HashField    string // Optional hash field name for hash operations
	Timeout      time.Duration
	TLSConfig    *tls.Config
	RetryDelay   time.Duration
	MaxRetries   int
	PoolSize     int
	MinIdleConns int
}

RedisConfig holds Redis client configuration

type RedisReader

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

RedisReader implements ConfReader for Redis-based configuration

func NewRedisReader

func NewRedisReader(uri string) (*RedisReader, error)

NewRedisReader creates a new Redis reader

func (*RedisReader) Close

func (r *RedisReader) Close() error

Close closes the reader and cleans up resources

func (*RedisReader) Read

func (r *RedisReader) Read(ctx context.Context) ([]byte, error)

Read reads configuration data from Redis key

func (*RedisReader) Subscribe

func (r *RedisReader) Subscribe(ctx context.Context) (<-chan *reader.ReadEvent, error)

Subscribe subscribes to Redis keyspace notifications for real-time updates

Jump to

Keyboard shortcuts

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