tutorial-redis/README.md

26 lines
578 B
Markdown
Raw Permalink 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)
```
### charpeter01
基本使用其中指令部分与redis-cli一致。
```
github.com/gomodule/redigo/redis
```
### charpeter02
基本使用
```
https://github.com/go-redis/redis
```