Files
EdgeCommon/pkg/serverconfigs/http_cache_config.go

25 lines
497 B
Go
Raw Normal View History

2020-10-04 20:38:03 +08:00
package serverconfigs
2020-12-18 21:19:25 +08:00
import "encoding/json"
2020-10-04 20:38:03 +08:00
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
}
2020-12-18 21:19:25 +08:00
func (this *HTTPCacheConfig) AsJSON() ([]byte, error) {
return json.Marshal(this)
}