mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 16:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			442 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			442 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
 | 
						|
 | 
						|
package caches
 | 
						|
 | 
						|
import "strings"
 | 
						|
 | 
						|
// PartialRangesFilePath 获取 ranges 文件路径
 | 
						|
func PartialRangesFilePath(path string) string {
 | 
						|
	// ranges路径
 | 
						|
	var dotIndex = strings.LastIndex(path, ".")
 | 
						|
	var rangePath string
 | 
						|
	if dotIndex < 0 {
 | 
						|
		rangePath = path + "@ranges.cache"
 | 
						|
	} else {
 | 
						|
		rangePath = path[:dotIndex] + "@ranges" + path[dotIndex:]
 | 
						|
	}
 | 
						|
	return rangePath
 | 
						|
}
 |