实现服务的缓存策略设置

This commit is contained in:
刘祥超
2020-10-04 20:38:03 +08:00
parent 75f653972d
commit ade44ce6c9
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
}