Add token to redis
(token string, param *TtyParameter, d time.Duration)
| 45 | |
| 46 | //Add token to redis |
| 47 | func (r *RedisCache) Add(token string, param *TtyParameter, d time.Duration) error { |
| 48 | b, err := json.Marshal(param) |
| 49 | if err != nil { |
| 50 | return err |
| 51 | } |
| 52 | return r.client.Set(context.Background(), r.prefix+token, string(b), d).Err() |
| 53 | } |