func (u *User) GetNotification(pushType, pushToken string) (bool, error) { r := common.DefaultRedisPool().Get() defer r.Close() token := fmt.Sprintf("%s:%s", pushType, pushToken) alert, err := redis.Int(r.Do("SISMEMBER", u.PushTokenListKey(), token)) return alert == 1, err }
func (um *UserManager) CheckAllowedUser(email string) bool { r := common.DefaultRedisPool().Get() defer r.Close() allowed, err := redis.Int(r.Do("SISMEMBER", "allowed_user", email)) if err != nil { log.Println("CheckAllowedUser Error:", err) return false } return allowed == 1 }