17 lines
403 B
Python
17 lines
403 B
Python
from typing import Literal
|
|
|
|
|
|
class StorageSettings(BaseModel):
|
|
type: StorageTypeEnum
|
|
|
|
|
|
class MemoryStorageSettings(StorageSettings):
|
|
type: Literal[StorageType.MEMORY.value] = StorageTypeEnum.MEMORY.value
|
|
|
|
|
|
class RedisStorageSettings(StorageSettings):
|
|
type: Litreal[StorageType.REDIS.value] = StorageTypeEnum.REDIS.value
|
|
host: str = "localhost"
|
|
port: int = 6379
|
|
database: int = 0
|