Allow caching based on a configurable number of hits. (#8891)

Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
poornas
2020-02-03 19:40:01 -08:00
committed by GitHub
parent a05af9bb98
commit 278a165674
12 changed files with 314 additions and 192 deletions

View File

@@ -34,6 +34,7 @@ type Config struct {
MaxUse int `json:"maxuse"`
Quota int `json:"quota"`
Exclude []string `json:"exclude"`
After int `json:"after"`
}
// UnmarshalJSON - implements JSON unmarshal interface for unmarshalling
@@ -60,7 +61,9 @@ func (cfg *Config) UnmarshalJSON(data []byte) (err error) {
if _cfg.Quota < 0 {
return errors.New("config quota value should not be null or negative")
}
if _cfg.After < 0 {
return errors.New("cache after value should not be less than 0")
}
return nil
}