Help us shape the future of Go! Take the 2026 Go Developer Survey

redis

package
v0.9.82 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Wrapper, *redis.Options)

func WithClientName

func WithClientName(name string) Option

func WithConnMaxIdleTime

func WithConnMaxIdleTime(connMaxIdleTime time.Duration) Option

func WithConnMaxLifetime

func WithConnMaxLifetime(connMaxLifetime time.Duration) Option

func WithConnectRetryBackoff

func WithConnectRetryBackoff(initial time.Duration, max time.Duration) Option

func WithConnectRetryTimeout

func WithConnectRetryTimeout(timeout time.Duration) Option

func WithContextTimeoutEnabled

func WithContextTimeoutEnabled(enabled bool) Option

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithMaxActiveConns

func WithMaxActiveConns(maxActiveConns int) Option

func WithMaxIdleConns

func WithMaxIdleConns(maxIdleConns int) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithMaxRetryBackoff

func WithMaxRetryBackoff(maxRetryBackoff time.Duration) Option

func WithMinIdleConns

func WithMinIdleConns(minIdleConns int) Option

func WithMinRetryBackoff

func WithMinRetryBackoff(minRetryBackoff time.Duration) Option

func WithPassword

func WithPassword(password string) Option

func WithPoolSize

func WithPoolSize(poolSize int) Option

func WithPoolTimeout

func WithPoolTimeout(poolTimeout time.Duration) Option

func WithReadTimeout

func WithReadTimeout(readTimeout time.Duration) Option

func WithUserName

func WithUserName(username string) Option

func WithWriteTimeout

func WithWriteTimeout(writeTimeout time.Duration) Option

type Wrapper

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

func Open

func Open(ctx context.Context, host string, db int, opts ...Option) (*Wrapper, error)

func (*Wrapper) AllowRateLimit

func (w *Wrapper) AllowRateLimit(
	ctx context.Context,
	key string,
	interval time.Duration,
	burst int,
	ttl time.Duration,
) (bool, error)

func (*Wrapper) Get

func (w *Wrapper) Get(ctx context.Context, key string) (string, bool, error)

func (*Wrapper) Invalidate

func (w *Wrapper) Invalidate(ctx context.Context, key string) error

func (*Wrapper) Ping

func (w *Wrapper) Ping(ctx context.Context) error

func (*Wrapper) Set

func (w *Wrapper) Set(ctx context.Context, key string, value string, ttl time.Duration) error

func (*Wrapper) SetIfAbsent

func (w *Wrapper) SetIfAbsent(
	ctx context.Context,
	key string,
	value string,
	ttl time.Duration,
) (bool, error)

func (*Wrapper) Shutdown

func (w *Wrapper) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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