1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 """An abstract class for caching the discovery document."""
16
17 import abc
18
19
20 -class Cache(object):
21 """A base abstract cache class."""
22
23 __metaclass__ = abc.ABCMeta
24
25 @abc.abstractmethod
27 """Gets the content from the memcache with a given key.
28
29 Args:
30 url: string, the key for the cache.
31
32 Returns:
33 object, the value in the cache for the given key, or None if the key is
34 not in the cache.
35 """
36 raise NotImplementedError()
37
38 @abc.abstractmethod
39 - def set(self, url, content):
40 """Sets the given key and content in the cache.
41
42 Args:
43 url: string, the key for the cache.
44 content: string, the discovery document.
45 """
46 raise NotImplementedError()
47