Ai
1 Star 0 Fork 0

saxon134/go-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
saRedis_base.go 481 Bytes
一键复制 编辑 原始数据 按行查看 历史
saxon134 提交于 2023-10-03 16:56 +08:00 . init
package saRedis
import (
"github.com/garyburd/redigo/redis"
"strings"
)
func (r Redis) Do(command string, args ...interface{}) (res interface{}, err error) {
c := r.Pool.Get()
defer c.Close()
res, err = c.Do(command, args...)
return
}
func (r Redis) WriteExpireAndNotExist(key, value string, expireTime int64) (ok bool) {
c := r.Pool.Get()
defer c.Close()
res, _ := redis.String(c.Do("SET", key, value, "EX", expireTime, "NX"))
return strings.ToUpper(res) == "OK"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/saxon134/go-utils.git
git@gitee.com:saxon134/go-utils.git
saxon134
go-utils
go-utils
b2602dc8c3fc

搜索帮助