mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-02-15 03:45:37 +08:00
实现缓存策略的部分功能
This commit is contained in:
@@ -17,7 +17,7 @@ func (this *HTTPRequestCondGroup) Init() error {
|
||||
if len(this.Connector) == 0 {
|
||||
this.Connector = "or"
|
||||
}
|
||||
|
||||
|
||||
if len(this.Conds) > 0 {
|
||||
for _, cond := range this.Conds {
|
||||
err := cond.Init()
|
||||
@@ -43,6 +43,14 @@ func (this *HTTPRequestCondGroup) MatchResponse(formatter func(source string) st
|
||||
return this.match(this.responseConds, formatter)
|
||||
}
|
||||
|
||||
func (this *HTTPRequestCondGroup) HasRequestConds() bool {
|
||||
return len(this.requestConds) > 0
|
||||
}
|
||||
|
||||
func (this *HTTPRequestCondGroup) HasResponseConds() bool {
|
||||
return len(this.responseConds) > 0
|
||||
}
|
||||
|
||||
func (this *HTTPRequestCondGroup) match(conds []*HTTPRequestCond, formatter func(source string) string) bool {
|
||||
if !this.IsOn || len(conds) == 0 {
|
||||
return !this.IsReverse
|
||||
|
||||
Reference in New Issue
Block a user