2010-12-11 15:38:40 +00:00
|
|
|
"""
|
|
|
|
|
Defines the base constance backend
|
|
|
|
|
"""
|
2010-12-01 17:13:37 +00:00
|
|
|
|
2013-04-12 15:39:10 +00:00
|
|
|
|
2019-12-23 21:20:41 +00:00
|
|
|
class Backend:
|
2010-12-01 17:13:37 +00:00
|
|
|
def get(self, key):
|
|
|
|
|
"""
|
2010-12-11 15:38:40 +00:00
|
|
|
Get the key from the backend store and return the value.
|
2010-12-01 17:13:37 +00:00
|
|
|
Return None if not found.
|
|
|
|
|
"""
|
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
2010-12-11 15:38:40 +00:00
|
|
|
def mget(self, keys):
|
|
|
|
|
"""
|
|
|
|
|
Get the keys from the backend store and return a list of the values.
|
|
|
|
|
Return an empty list if not found.
|
|
|
|
|
"""
|
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
2010-12-01 17:13:37 +00:00
|
|
|
def set(self, key, value):
|
|
|
|
|
"""
|
|
|
|
|
Add the value to the backend store given the key.
|
|
|
|
|
"""
|
|
|
|
|
raise NotImplementedError
|