func (v *validatorRule) Valid(w http.ResponseWriter, r *http.Request) bool {
	for _, valid := range v.postValidators {
		if !valid(w, r) {
			return false
		}
	}
	return true
}
Valid returns true if incoming request and post-response from the original handler
is valid to be store to the cache, if not(false) then the consumer should just exit
otherwise(true) the consumer should store the cached response
package rule
import (
	"net/http"
)
type PreValidator func(*http.Request) bool
type PostValidator func(http.ResponseWriter, *http.Request) bool
type validatorRule struct {
	preValidators []PreValidator
	postValidators []PostValidator
}
var _ Rule = &validatorRule{}
func DefaultValidator() Rule { return Validator(nil, nil) }
func Validator(preValidators []PreValidator, postValidators []PostValidator) Rule {
	return &validatorRule{
		preValidators:  preValidators,
		postValidators: postValidators,
	}
}
func (v *validatorRule) Claim(r *http.Request) bool {
	for _, shouldProcess := range v.preValidators {
		if !shouldProcess(r) {
			return false
		}
	}
	return true
}