实现服务的缓存策略设置

This commit is contained in:
GoEdgeLab
2020-10-04 20:38:03 +08:00
parent 50886bf57a
commit 1f11037d45
10 changed files with 121 additions and 115 deletions

View File

@@ -0,0 +1,18 @@
package serverconfigs
type HTTPCacheConfig struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"`
IsOn bool `yaml:"isOn" json:"isOn"`
CacheRefs []*HTTPCacheRef `yaml:"cacheRefs" json:"cacheRefs"` // 缓存配置
}
func (this *HTTPCacheConfig) Init() error {
for _, cacheRef := range this.CacheRefs {
err := cacheRef.Init()
if err != nil {
return err
}
}
return nil
}