redisx

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmdable

type Cmdable interface {
	redis.Cmdable
	Obtain(ctx context.Context, key string, ttl time.Duration) (*redislock.Lock, error)
}

func Must

func Must(opts ...Option) Cmdable

type Config

type Config struct {
	Source   string   `yaml:"source" json:"source"`
	Addrs    []string `yaml:"addrs" json:"addrs"`
	Password string   `yaml:"password" json:"password" cipher:"true"`
	Db       int      `yaml:"db" json:"db"`
}

type Option

type Option func(*Redis)

func WithConfig

func WithConfig(c Config) Option

func WithHooks

func WithHooks(hks ...redis.Hook) Option

type Redis

type Redis struct {
	redis.Cmdable
	// contains filtered or unexported fields
}

func (*Redis) Obtain

func (r *Redis) Obtain(ctx context.Context, key string, ttl time.Duration) (*redislock.Lock, error)

Jump to

Keyboard shortcuts

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