mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	缓存策略实现LFU算法/实现内存缓存自动Flush数据到磁盘
This commit is contained in:
		@@ -22,7 +22,10 @@ type ListInterface interface {
 | 
			
		||||
	Remove(hash string) error
 | 
			
		||||
 | 
			
		||||
	// Purge 清理过期数据
 | 
			
		||||
	Purge(count int, callback func(hash string) error) error
 | 
			
		||||
	Purge(count int, callback func(hash string) error) (int, error)
 | 
			
		||||
 | 
			
		||||
	// PurgeLFU 清理LFU数据
 | 
			
		||||
	PurgeLFU(count int, callback func(hash string) error) error
 | 
			
		||||
 | 
			
		||||
	// CleanAll 清除所有缓存
 | 
			
		||||
	CleanAll() error
 | 
			
		||||
@@ -41,4 +44,7 @@ type ListInterface interface {
 | 
			
		||||
 | 
			
		||||
	// Close 关闭
 | 
			
		||||
	Close() error
 | 
			
		||||
 | 
			
		||||
	// IncreaseHit 增加点击量
 | 
			
		||||
	IncreaseHit(hash string) error
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user