redisxx

package
v0.0.0-...-ec1e856 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

* * Copyright (C) 2021-2022 * All rights reserved, Designed By www.github.com/xiatian0716 * 注意:本软件为www.github.com/xiatian0716开发研制

Index

Constants

This section is empty.

Variables

View Source
var RedisConn *redis.Pool

Functions

func Delete

func Delete(key string) (bool, error)

Delete delete a kye

func Exists

func Exists(key string) bool

Exists check a key

func Get

func Get(key string) ([]byte, error)

Get a key

func GetMap

func GetMap(key string) (map[string]string, error)

func GetString

func GetString(key string) string

Get get a key

func LikeDeletes

func LikeDeletes(key string) error

LikeDeletes batch delete

func RedisClose

func RedisClose()

func Set

func Set(key string, data interface{}, time int) error

Set a key/value

func SetEx

func SetEx(key, val string, exp int64) error

func Setup

func Setup(r Redis) error

Setup Initialize the Redis instance

Types

type Redis

type Redis struct {
	Host        string        `mapstructure:"host"`
	Password    string        `mapstructure:"password"`
	MaxIdle     int           `mapstructure:"max-idle"`
	MaxActive   int           `mapstructure:"max-active"`
	IdleTimeout time.Duration `mapstructure:"idle-timeout"`
}

Jump to

Keyboard shortcuts

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