mirror of
				https://github.com/LamGC/ContentGrabbingJi.git
				synced 2025-10-31 00:26:56 +00:00 
			
		
		
		
	[Add] CacheStore-api 增加对缓存存储源类型的标注, 以协助 Core 按需选择缓存容器;
[Add] CacheStoreSource 增加缓存存储源类型枚举类, 暂时添加目前已涉及的类型; [Update] Factory 增加 CacheStoreSource 项目(因为 CacheStoreSource 是没有更改需要的;
This commit is contained in:
		
							
								
								
									
										37
									
								
								ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreSource.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreSource.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| /* | ||||
|  * Copyright (C) 2020  LamGC | ||||
|  * | ||||
|  * ContentGrabbingJi is free software: you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU Affero General Public License as | ||||
|  * published by the Free Software Foundation, either version 3 of the | ||||
|  * License, or (at your option) any later version. | ||||
|  * | ||||
|  * ContentGrabbingJi is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  * GNU Affero General Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU Affero General Public License | ||||
|  * along with this program.  If not, see <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package net.lamgc.cgj.bot.cache; | ||||
|  | ||||
| /** | ||||
|  * 缓存容器类型. | ||||
|  * @author LamGC | ||||
|  */ | ||||
| public enum CacheStoreSource { | ||||
|     /** | ||||
|      * 内存存储(速度最快). | ||||
|      */ | ||||
|     MEMORY, | ||||
|     /** | ||||
|      * 本地存储(单机存储). | ||||
|      */ | ||||
|     LOCAL, | ||||
|     /** | ||||
|      * 远端存储(例如网络, 可多机读写且与单机无关). | ||||
|      */ | ||||
|     REMOTE | ||||
| } | ||||
| @ -47,4 +47,11 @@ public @interface Factory { | ||||
|      */ | ||||
|     int priority() default FactoryPriority.PRIORITY_NORMAL; | ||||
|  | ||||
|     /** | ||||
|      * CacheStore 存储源类型. | ||||
|      * <p> 可帮助 Core 根据需要选择对应的类型(比如部分低TTL临时缓存追求速度不强求持久化, 建立热点数据高频短时缓存等). | ||||
|      * @return 返回存储源类型. | ||||
|      */ | ||||
|     CacheStoreSource source() default CacheStoreSource.LOCAL; | ||||
|  | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user