2020-10-08 15:06:42 +08:00
|
|
|
package requests
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
)
|
|
|
|
|
|
2021-07-18 15:51:49 +08:00
|
|
|
type Request interface {
|
|
|
|
|
// WAFRaw 原始请求
|
|
|
|
|
WAFRaw() *http.Request
|
2020-10-08 15:06:42 +08:00
|
|
|
|
2021-07-18 15:51:49 +08:00
|
|
|
// WAFRemoteIP 客户端IP
|
|
|
|
|
WAFRemoteIP() string
|
2020-10-08 15:06:42 +08:00
|
|
|
|
2021-07-18 15:51:49 +08:00
|
|
|
// WAFGetCacheBody 获取缓存中的Body
|
|
|
|
|
WAFGetCacheBody() []byte
|
2020-10-08 15:06:42 +08:00
|
|
|
|
2021-07-18 15:51:49 +08:00
|
|
|
// WAFSetCacheBody 设置Body
|
|
|
|
|
WAFSetCacheBody(body []byte)
|
|
|
|
|
|
|
|
|
|
// WAFReadBody 读取Body
|
|
|
|
|
WAFReadBody(max int64) (data []byte, err error)
|
|
|
|
|
|
|
|
|
|
// WAFRestoreBody 恢复Body
|
|
|
|
|
WAFRestoreBody(data []byte)
|
2020-10-08 15:06:42 +08:00
|
|
|
|
2021-07-18 15:51:49 +08:00
|
|
|
// WAFServerId 服务ID
|
|
|
|
|
WAFServerId() int64
|
2020-10-08 15:06:42 +08:00
|
|
|
}
|