20 lines
442 B
Python
20 lines
442 B
Python
import redis
|
|
|
|
redis_url = 'redis://default:redispw@localhost:32768'
|
|
r = redis.StrictRedis.from_url(redis_url)
|
|
|
|
'''r.set('hello', 'world')
|
|
value = r.get('hello')
|
|
print(value)'''
|
|
|
|
|
|
class DB:
|
|
|
|
def getEntry(self, tiploc):
|
|
return r.hget("tiploc", tiploc)
|
|
|
|
def getHash(self, tiploc):
|
|
response = r.hgetall("tiploc:"+tiploc)
|
|
response = {a.decode(): response[a].decode() for a in response}
|
|
return response
|
|
|