redis

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Set(k string, p string, v interface{}, d time.Duration) error
	Delete(k string, p string) error
	Get(k string, p string) (v string, err error)
	Ttl(k string, p string) (t time.Duration, err error)
}

func NewClusterRedis

func NewClusterRedis(o *Options) Cacher

func NewRedis

func NewRedis(o *Options) Cacher

type ClusterRedis

type ClusterRedis struct {
	Cache *redis.ClusterClient
}

func (ClusterRedis) Delete

func (r ClusterRedis) Delete(k string, p string) error

func (ClusterRedis) Get

func (r ClusterRedis) Get(k string, p string) (v string, err error)

func (ClusterRedis) Set

func (r ClusterRedis) Set(k string, p string, v interface{}, d time.Duration) error

func (ClusterRedis) Ttl

func (r ClusterRedis) Ttl(k string, p string) (t time.Duration, err error)

type Options

type Options struct {
	Addrs       []string
	Passwd      string
	Index       int
	PoolSize    *int
	PoolTimeout *time.Duration
	MinIdleConn *int
}

type Redis

type Redis struct {
	Cache *redis.Client
}

func (Redis) Delete

func (r Redis) Delete(k string, p string) error

func (Redis) Get

func (r Redis) Get(k string, p string) (string, error)

func (Redis) Set

func (r Redis) Set(k string, p string, v interface{}, d time.Duration) error

func (Redis) Ttl

func (r Redis) Ttl(k string, p string) (t time.Duration, err error)

Jump to

Keyboard shortcuts

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