redis

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 6 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.Cmdable
	DefaultTTL time.Duration
}

func ConnectRetry

func ConnectRetry(ctx context.Context, config Config, defaultTTL time.Duration, errChan chan<- error) (*Client, error)

type Config

type Config struct {
	Hosts     string `envconfig:"HOSTS" default:"127.0.0.1" required:"true"`
	Port      int    `envconfig:"PORT" default:"6379" required:"true"`
	Username  string `envconfig:"USERNAME"`
	Password  string `envconfig:"PASSWORD"`
	Database  int    `envconfig:"DATABASE" default:"0"`
	IsCluster bool   `envconfig:"DATABASE" default:"false"`
}

func (Config) DSN

func (c Config) DSN() string

Jump to

Keyboard shortcuts

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