实现open file cache

This commit is contained in:
GoEdgeLab
2022-01-12 21:09:23 +08:00
parent bdbfc03ffe
commit 7b8e05b445
2 changed files with 24 additions and 1 deletions

View File

@@ -1,11 +1,19 @@
package serverconfigs
// 文件缓存存储策略
// HTTPFileCacheStorage 文件缓存存储策略
type HTTPFileCacheStorage struct {
Dir string `yaml:"dir" json:"dir"` // 目录
MemoryPolicy *HTTPCachePolicy `yaml:"memoryPolicy" json:"memoryPolicy"` // 内存二级缓存
OpenFileCache *OpenFileCacheConfig `yaml:"openFileCache" json:"openFileCache"` // open file cache配置
}
func (this *HTTPFileCacheStorage) Init() error {
if this.OpenFileCache != nil {
err := this.OpenFileCache.Init()
if err != nil {
return err
}
}
return nil
}