Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /allen0099_FastAPI-CacheX /fastapi_cachex /backends /config.py
| """Configuration models for cache backends.""" | |
| from pydantic import BaseModel | |
| from pydantic import Field | |
| from pydantic import SecretStr | |
| DEFAULT_REDIS_PREFIX = "fastapi_cachex:" | |
| class RedisConfig(BaseModel): | |
| """Configuration for Redis backend.""" | |
| host: str = Field(default="localhost", description="Redis server address") | |
| port: int = Field(default=6379, ge=1, le=65535, description="Redis server port") | |
| password: SecretStr | None = Field( | |
| default=None, description="Redis server password" | |
| ) | |
| db: int = Field(default=0, ge=0, description="Redis database number") | |
| encoding: str = Field(default="utf-8", description="Character encoding to use") | |
| socket_timeout: float = Field( | |
| default=1.0, description="Timeout for socket operations in seconds" | |
| ) | |
| socket_connect_timeout: float = Field( | |
| default=1.0, description="Timeout for socket connection in seconds" | |
| ) | |
| key_prefix: str = Field( | |
| default=DEFAULT_REDIS_PREFIX, | |
| description="Prefix applied to all cache keys", | |
| ) | |
| protocol: int = Field( | |
| default=2, | |
| ge=2, | |
| le=3, | |
| description=( | |
| "RESP protocol version (2 or 3). " | |
| "Keep at 2 (default) unless you need RESP3 features and your hiredis " | |
| "version supports it (hiredis >= 3.0 is required for RESP3). " | |
| "Redis 8.0 supports RESP3 but older hiredis builds do not." | |
| ), | |
| ) | |
Xet Storage Details
- Size:
- 1.44 kB
- Xet hash:
- c5dbca67754882c53a6994ca73d950b5bffb67a336b2d08872db8d5c8467593e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.