Example #1
0
func alreadyBeingHandled(input string) bool {

	c := redis.Client{Addr: addr, Password: pass}
	c.Auth(pass)
	check, _ := c.Exists(input)
	return check

}
Example #2
0
func setToBeHandled(input string) {

	c := redis.Client{Addr: addr, Password: pass}
	c.Auth(pass)

	c.Set(input, "1")
	c.Expire(input, EXPIRETIME)

}
Example #3
0
func checkLearningDB(msg string) bool {
	/*set up redis client*/
	c := redis.Client{Addr: addr, Password: pass}
	c.Auth(pass)

	// hash the message
	hash := md5hash(msg) // check databse
	check, _ := c.Exists(hash)

	if check == true {
		return true
	} else {

		return false
	}

}