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
			| 
								 
											1 year ago
										 
									 | 
							
								from pydantic import BaseModel, ConfigDict, Field
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								from pydantic.alias_generators import to_camel
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								from typing import Any, List, Optional
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class CacheMonitorModel(BaseModel):
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    缓存监控信息对应pydantic模型
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    model_config = ConfigDict(alias_generator=to_camel)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								    command_stats: Optional[List] = Field(default=[], description='命令统计')
							 | 
						||
| 
								 | 
							
								    db_size: Optional[int] = Field(default=None, description='Key数量')
							 | 
						||
| 
								 | 
							
								    info: Optional[dict] = Field(default={}, description='Redis信息')
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class CacheInfoModel(BaseModel):
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    缓存监控对象对应pydantic模型
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    model_config = ConfigDict(alias_generator=to_camel)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											1 year 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='备注')
							 |