阶段性提交

This commit is contained in:
GoEdgeLab
2020-09-13 19:27:47 +08:00
commit f3289fff09
120 changed files with 19900 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package shared
// 状态吗
type HTTPStatusConfig struct {
Always bool `yaml:"always" json:"always"`
Codes []int `yaml:"codes" json:"codes"`
}
func (this *HTTPStatusConfig) Init() error {
// TODO
return nil
}
func (this *HTTPStatusConfig) Match(statusCode int) bool {
if this.Always {
return true
}
if len(this.Codes) == 0 {
return false
}
for _, c := range this.Codes {
if c == statusCode {
return true
}
}
return false
}