You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
981 B
29 lines
981 B
7 months ago
|
from pydantic import BaseModel, ConfigDict, Field
|
||
1 year ago
|
from pydantic.alias_generators import to_camel
|
||
7 months ago
|
from typing import Any, List, Optional
|
||
1 year ago
|
|
||
|
|
||
|
class CacheMonitorModel(BaseModel):
|
||
|
"""
|
||
|
缓存监控信息对应pydantic模型
|
||
|
"""
|
||
7 months ago
|
|
||
1 year ago
|
model_config = ConfigDict(alias_generator=to_camel)
|
||
|
|
||
7 months ago
|
command_stats: Optional[List] = Field(default=[], description='命令统计')
|
||
|
db_size: Optional[int] = Field(default=None, description='Key数量')
|
||
|
info: Optional[dict] = Field(default={}, description='Redis信息')
|
||
1 year ago
|
|
||
|
|
||
|
class CacheInfoModel(BaseModel):
|
||
|
"""
|
||
|
缓存监控对象对应pydantic模型
|
||
|
"""
|
||
7 months ago
|
|
||
1 year ago
|
model_config = ConfigDict(alias_generator=to_camel)
|
||
|
|
||
7 months ago
|
cache_key: Optional[str] = Field(default=None, description='缓存键名')
|
||
|
cache_name: Optional[str] = Field(default=None, description='缓存名称')
|
||
|
cache_value: Optional[Any] = Field(default=None, description='缓存内容')
|
||
|
remark: Optional[str] = Field(default=None, description='备注')
|