Files
EdgeNode/internal/waf/checkpoints/checkpoint_interface.go

47 lines
1.1 KiB
Go
Raw Permalink Normal View History

2020-10-08 15:06:42 +08:00
package checkpoints
import (
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
2023-10-11 12:21:10 +08:00
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
"github.com/iwind/TeaGo/maps"
2020-10-08 15:06:42 +08:00
)
2021-07-18 15:51:49 +08:00
// CheckpointInterface Check Point
2020-10-08 15:06:42 +08:00
type CheckpointInterface interface {
2021-07-18 15:51:49 +08:00
// Init initialize
2020-10-08 15:06:42 +08:00
Init()
2021-07-18 15:51:49 +08:00
// IsRequest is request?
2020-10-08 15:06:42 +08:00
IsRequest() bool
2021-07-18 15:51:49 +08:00
// IsComposed is composed?
IsComposed() bool
2021-07-18 15:51:49 +08:00
// RequestValue get request value
2023-10-11 12:21:10 +08:00
RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error)
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// ResponseValue get response value
2023-10-11 12:21:10 +08:00
ResponseValue(req requests.Request, resp *requests.Response, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error)
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// ParamOptions param option list
2020-10-08 15:06:42 +08:00
ParamOptions() *ParamOptions
2021-07-18 15:51:49 +08:00
// Options options
2020-10-08 15:06:42 +08:00
Options() []OptionInterface
2021-07-18 15:51:49 +08:00
// Start start
2020-10-08 15:06:42 +08:00
Start()
2021-07-18 15:51:49 +08:00
// Stop stop
2020-10-08 15:06:42 +08:00
Stop()
// SetPriority set priority
SetPriority(priority int)
2023-10-11 12:21:10 +08:00
// Priority get priority
Priority() int
2023-10-11 12:21:10 +08:00
// CacheLife regexp cache life
CacheLife() utils.CacheLife
2020-10-08 15:06:42 +08:00
}