package auth import ( "time" ) // Storer type Storer interface { //Get 获取令牌内容 Get(userId string) (string, error) // Set 放入令牌,指定到期时间(时间非必填) Set(userId string, value interface{}, expiration ...time.Duration) error //Check 检查令牌是否存在 Check(userId string) (bool, error) // 删除 Del(userId string) error //Close 关闭存储 Close() error }