add logout api

This commit is contained in:
root committed 2018-04-18 15:05:37 +08:00
1 parent 6419162471
commit d86e8e47f4
3 files changed
+41

No files matched your search

+22
View File
@@ -64,3 +64,25 @@ func RedisGet(namespace, key string) (string, error) {
val, err := redisStore.Get(key).Result()
return val, err
}
// RedisDel -
func RedisDel(namespace, key string) error {
var n string
if len(namespace) > 0 {
n += namespace
n += ":"
}
if len(key) == 0 {
return errors.New("key empty")
}
if len(n) > 0 {
n += ":"
}
n += key
err := redisStore.Del(n).Err()
return err
}