Skip to content

Commit

Permalink
Add delete token method
Browse files Browse the repository at this point in the history
  • Loading branch information
saromanov committed Jan 10, 2019
1 parent 84ea008 commit 2639a6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion redisdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func (r *RedisDL) lock(ctx context.Context) error {
case <-retry.C:
}
}
return nil
}

// storeToken provides store of token
Expand All @@ -77,6 +76,12 @@ func (r *RedisDL) storeToken(token string) error {

}

// deleteToken provides removing of the token from redis
func (r *RedisDL) deleteToken() error {
_, err := r.client.Del(r.key).Result()
return err
}

func randToken() (string, error) {
b := make([]byte, 16)
if _, err := rand.Read(b); err != nil {
Expand Down

0 comments on commit 2639a6e

Please sign in to comment.