Exemplo n.º 1
0
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
}
Exemplo n.º 2
0
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
}