store.go 410 B

12345678910111213141516171819
  1. package auth
  2. import (
  3. "time"
  4. )
  5. // Storer
  6. type Storer interface {
  7. //Get 获取令牌内容
  8. Get(userId string) (string, error)
  9. // Set 放入令牌,指定到期时间(时间非必填)
  10. Set(userId string, value interface{}, expiration ...time.Duration) error
  11. //Check 检查令牌是否存在
  12. Check(userId string) (bool, error)
  13. // 删除
  14. Del(userId string) error
  15. //Close 关闭存储
  16. Close() error
  17. }