tutorial-redis/README.md

18 lines
646 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# tutorial-redis
### 概述
golang官方推荐的有redisgo和go-reids个人认为go-redis的封装更加人性化redisgo的调用是基于命令的go-redis是基于方法的。
2行代码来比较下2种资源包的调用方式
redisgo client.Do("SETEX", "cp01", 3600, []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
go-redisclient.Set("mykey", "我是数据", time.Hour)
同样是存储一个1小时后过期的数据go-redis的调用方式明显更友好。
### charpeter01
基本使用其中指令部分与redis-cli一致。
github.com/gomodule/redigo/redis
### charpeter02
基本使用
https://github.com/go-redis/redis