redisMng

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisMng

type RedisMng struct {
	//config configStruct.Redis
	Pool redis.Pool
	Conn redis.Conn
}

*

  • @func:实例化一个redis连接池
  • @author Hank
  • @date 2019-02-24

func NewRedisMng

func NewRedisMng() *RedisMng

*

  • @func: NewRedisMng 返回一个redis管理器实例
  • @author: Wiidz
  • @date: 2020-04-15

func (*RedisMng) Get

func (mng *RedisMng) Get(key string) (string, error)

*

  • @func: Get 读取指定键的值
  • @author: Wiidz
  • @date: 2020-04-15
  • @Param: [key] 键名
  • @return: [str] 键值

func (*RedisMng) HDel

func (mng *RedisMng) HDel(key_name string, fields ...string) (interface{}, error)

* * @func: HDEL 删除hash里的key * @author Hank * @date 2019-06-21

func (*RedisMng) HExists

func (mng *RedisMng) HExists(key_name, field_name string) (interface{}, error)

func (*RedisMng) HGet

func (mng *RedisMng) HGet(key_name, field string) (interface{}, error)

-------BEGIN------哈希相关的操作-----BEGIN-------- * * @func: HSGet 设置key * @author Hank * @date 2019-06-21

func (*RedisMng) HIncrby

func (mng *RedisMng) HIncrby(key_name, field_name, incr_by_number interface{}) (res interface{}, err error)

/** * @func: HINCRBY 增加hash中的字段的值 返回的是字段被修改过后的值 * @author Hank * @date 2019-06-21 */

func (*RedisMng) HKeys

func (mng *RedisMng) HKeys(key_name string) (interface{}, error)

/** * @func: HKEYS 获取hash中所有的field * @author Hank * @date 2019-06-21 */

func (*RedisMng) HLen

func (mng *RedisMng) HLen(key_name string) (res interface{}, err error)

/** * @func: HLEN hash 中 一个key下的数量 * @author Hank * @date 2019-06-21 */

func (*RedisMng) HSet

func (mng *RedisMng) HSet(key_name, field string, value interface{}) (interface{}, error)

* * @func: HSET 设置key * @author Hank * @date 2019-06-21

func (*RedisMng) Set

func (mng *RedisMng) Set(key string, value interface{}, expire int) error

*

  • @func: Set 设置键值
  • @author: Wiidz
  • @date: 2020-04-15
  • @Param: [key] 键名
  • [value] 键值
  • [expire] 过期时间(秒)

Jump to

Keyboard shortcuts

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