边缘节点支持设置多个缓存目录

This commit is contained in:
刘祥超
2022-11-15 20:35:39 +08:00
parent 4d5fd28f97
commit ea58e6094c
8 changed files with 4211 additions and 4155 deletions

View File

@@ -1,8 +1,16 @@
package serverconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
type CacheDir struct {
Path string `yaml:"path" json:"path"` // 目录
Capacity *shared.SizeCapacity `yaml:"capacity" json:"capacity"` // 容量限制 TODO 暂时不实现
}
// HTTPFileCacheStorage 文件缓存存储策略
type HTTPFileCacheStorage struct {
Dir string `yaml:"dir" json:"dir"` // 目录
SubDirs []*CacheDir `yaml:"cacheDir" json:"subDirs"` // 子目录
MemoryPolicy *HTTPCachePolicy `yaml:"memoryPolicy" json:"memoryPolicy"` // 内存二级缓存
OpenFileCache *OpenFileCacheConfig `yaml:"openFileCache" json:"openFileCache"` // open file cache配置