redis

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNodes      = errors.New("no nodes available")
	ErrNodeNotFound = errors.New("node not found")
)

Functions

func NewClient

func NewClient(ctx context.Context, address string) (*redis.Client, error)

Types

type ShardedClient

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

func NewShardedClient

func NewShardedClient(ctx context.Context, shardAddresses []string) (*ShardedClient, error)

func (*ShardedClient) AddNode

func (rsc *ShardedClient) AddNode(ctx context.Context, address string) error

func (*ShardedClient) Close

func (rsc *ShardedClient) Close()

func (*ShardedClient) GetShard

func (rsc *ShardedClient) GetShard(key string) (*redis.Client, error)

func (*ShardedClient) Nodes

func (rsc *ShardedClient) Nodes() []string

func (*ShardedClient) RemoveNode

func (rsc *ShardedClient) RemoveNode(ctx context.Context, address string)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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