| 1 |
""" |
| 2 |
flask_caching.backends |
| 3 |
~~~~~~~~~~~~~~~~~~~~~~ |
| 4 |
|
| 5 |
Various caching backends. |
| 6 |
|
| 7 |
:copyright: (c) 2018 by Peter Justin. |
| 8 |
:copyright: (c) 2010 by Thadeus Burgess. |
| 9 |
:license: BSD, see LICENSE for more details. |
| 10 |
""" |
| 11 |
|
| 12 |
from flask_caching.backends.filesystemcache import FileSystemCache |
| 13 |
from flask_caching.backends.memcache import MemcachedCache |
| 14 |
from flask_caching.backends.memcache import SASLMemcachedCache |
| 15 |
from flask_caching.backends.memcache import SpreadSASLMemcachedCache |
| 16 |
from flask_caching.backends.nullcache import NullCache |
| 17 |
from flask_caching.backends.rediscache import RedisCache |
| 18 |
from flask_caching.backends.rediscache import RedisClusterCache |
| 19 |
from flask_caching.backends.rediscache import RedisSentinelCache |
| 20 |
from flask_caching.backends.simplecache import SimpleCache |
| 21 |
from flask_caching.backends.uwsgicache import UWSGICache |
| 22 |
|
| 23 |
__all__ = ( |
| 24 |
"null", |
| 25 |
"simple", |
| 26 |
"filesystem", |
| 27 |
"redis", |
| 28 |
"redissentinel", |
| 29 |
"rediscluster", |
| 30 |
"uwsgi", |
| 31 |
"memcached", |
| 32 |
"gaememcached", |
| 33 |
"saslmemcached", |
| 34 |
"spreadsaslmemcached", |
| 35 |
) |
| 36 |
|
| 37 |
|
| 38 |
def null(app, config, args, kwargs): |
| 39 |
return NullCache.factory(app, config, args, kwargs) |
| 40 |
|
| 41 |
|
| 42 |
def simple(app, config, args, kwargs): |
| 43 |
return SimpleCache.factory(app, config, args, kwargs) |
| 44 |
|
| 45 |
|
| 46 |
def filesystem(app, config, args, kwargs): |
| 47 |
return FileSystemCache.factory(app, config, args, kwargs) |
| 48 |
|
| 49 |
|
| 50 |
def redis(app, config, args, kwargs): |
| 51 |
return RedisCache.factory(app, config, args, kwargs) |
| 52 |
|
| 53 |
|
| 54 |
def redissentinel(app, config, args, kwargs): |
| 55 |
return RedisSentinelCache.factory(app, config, args, kwargs) |
| 56 |
|
| 57 |
|
| 58 |
def rediscluster(app, config, args, kwargs): |
| 59 |
return RedisClusterCache.factory(app, config, args, kwargs) |
| 60 |
|
| 61 |
|
| 62 |
def uwsgi(app, config, args, kwargs): |
| 63 |
return UWSGICache.factory(app, config, args, kwargs) |
| 64 |
|
| 65 |
|
| 66 |
def memcached(app, config, args, kwargs): |
| 67 |
return MemcachedCache.factory(app, config, args, kwargs) |
| 68 |
|
| 69 |
|
| 70 |
def gaememcached(app, config, args, kwargs): |
| 71 |
return memcached(app, config, args, kwargs) |
| 72 |
|
| 73 |
|
| 74 |
def saslmemcached(app, config, args, kwargs): |
| 75 |
return SASLMemcachedCache.factory(app, config, args, kwargs) |
| 76 |
|
| 77 |
|
| 78 |
def spreadsaslmemcached(app, config, args, kwargs): |
| 79 |
return SpreadSASLMemcachedCache.factory(app, config, args, kwargs) |