redis

package
v0.0.0-...-3d9ae3b Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

*

  • @Author: kwens
  • @Date: 2022-11-15 16:53:02
  • @Description:

*

  • @Author: kwens
  • @Date: 2022-11-15 16:51:47
  • @Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr            string `json:"addr"`
	Port            int    `json:"port"`
	Password        string `json:"password"`
	DB              int    `json:"db"`
	MaxIdle         int    `json:"max_idle"`
	MaxActive       int    `json:"max_active"`
	IdleTimeout     int    `json:"idle_timeout"`
	Wait            bool   `json:"wait"`
	MaxConnLifeTime int    `json:"max_conn_life_time"`
	BaseKey         string `json:"base_key"`
}

Config 配置结构

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithRedisConfig

func WithRedisConfig(redisConf Config) Option

type Redis

type Redis interface {
	Get(key string, result interface{}) (err error)
	GetDel(key string, result interface{}) (err error)
	Set(key string, value interface{}) (err error)
	SetEx(key string, value interface{}, ex int) (err error)
	GetSet(key string, result interface{}, value interface{}) (err error)
	ExistsDel(key string) (exists bool, err error)
	Del(key string) (err error)
	Exists(key string) (exists bool, err error)
	Incr(key string) (result int, err error)
	IncrEx(key string, ex int) (result int, err error)
	TTL(key string) (result int, err error)
	LLen(key string) (result int, err error)
	RPush(key string, value interface{}) (newLen int, err error)
	RPushX(key string, value interface{}) (newLen int, err error)
	LPop(key string, result interface{}) error
	BLPop(keys []string, timeout int, result interface{}) (key string, err error)
	ScanAll(match string, count ...int) (keys []string, err error)
}

func New

func New(conf Config) (Redis, error)

Jump to

Keyboard shortcuts

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