Documentation ¶
Index ¶
- type Request
- type Response
- type TestRequest
- func (this *TestRequest) DisableAccessLog()
- func (this *TestRequest) DisableStat()
- func (this *TestRequest) Format(s string) string
- func (this *TestRequest) ProcessResponseHeaders(headers http.Header, status int)
- func (this *TestRequest) WAFClose()
- func (this *TestRequest) WAFFingerprint() []byte
- func (this *TestRequest) WAFGetCacheBody() []byte
- func (this *TestRequest) WAFMaxRequestSize() int64
- func (this *TestRequest) WAFOnAction(action any) bool
- func (this *TestRequest) WAFRaw() *http.Request
- func (this *TestRequest) WAFReadBody(max int64) (data []byte, err error)
- func (this *TestRequest) WAFRemoteAddr() string
- func (this *TestRequest) WAFRemoteIP() string
- func (this *TestRequest) WAFRestoreBody(data []byte)
- func (this *TestRequest) WAFServerId() int64
- func (this *TestRequest) WAFSetCacheBody(bodyData []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request interface { // WAFRaw 原始请求 WAFRaw() *http.Request // WAFRemoteIP 客户端IP WAFRemoteIP() string // WAFGetCacheBody 获取缓存中的Body WAFGetCacheBody() []byte // WAFSetCacheBody 设置Body WAFSetCacheBody(body []byte) // WAFReadBody 读取Body WAFReadBody(max int64) (data []byte, err error) // WAFRestoreBody 恢复Body WAFRestoreBody(data []byte) // WAFServerId 服务ID WAFServerId() int64 // WAFClose 关闭当前请求所在的连接 WAFClose() // WAFOnAction 动作回调 WAFOnAction(action any) (goNext bool) // WAFFingerprint 读取连接指纹 WAFFingerprint() []byte // WAFMaxRequestSize 可以检查的最大内容尺寸 WAFMaxRequestSize() int64 // Format 格式化变量 Format(string) string // ProcessResponseHeaders 处理响应Header ProcessResponseHeaders(headers http.Header, status int) // DisableAccessLog 在当前请求中不使用访问日志 DisableAccessLog() // DisableStat 在当前请求中停用统计 DisableStat() }
type Response ¶
func NewResponse ¶
type TestRequest ¶
type TestRequest struct { BodyData []byte // contains filtered or unexported fields }
func NewTestRequest ¶
func NewTestRequest(raw *http.Request) *TestRequest
func (*TestRequest) DisableAccessLog ¶ added in v1.0.0
func (this *TestRequest) DisableAccessLog()
func (*TestRequest) DisableStat ¶ added in v1.3.0
func (this *TestRequest) DisableStat()
func (*TestRequest) Format ¶
func (this *TestRequest) Format(s string) string
func (*TestRequest) ProcessResponseHeaders ¶ added in v1.2.7
func (this *TestRequest) ProcessResponseHeaders(headers http.Header, status int)
func (*TestRequest) WAFFingerprint ¶ added in v1.0.0
func (this *TestRequest) WAFFingerprint() []byte
func (*TestRequest) WAFGetCacheBody ¶
func (this *TestRequest) WAFGetCacheBody() []byte
func (*TestRequest) WAFMaxRequestSize ¶ added in v1.2.7
func (this *TestRequest) WAFMaxRequestSize() int64
func (*TestRequest) WAFOnAction ¶
func (this *TestRequest) WAFOnAction(action any) bool
func (*TestRequest) WAFRaw ¶
func (this *TestRequest) WAFRaw() *http.Request
func (*TestRequest) WAFReadBody ¶
func (this *TestRequest) WAFReadBody(max int64) (data []byte, err error)
func (*TestRequest) WAFRemoteAddr ¶
func (this *TestRequest) WAFRemoteAddr() string
func (*TestRequest) WAFRemoteIP ¶
func (this *TestRequest) WAFRemoteIP() string
func (*TestRequest) WAFRestoreBody ¶
func (this *TestRequest) WAFRestoreBody(data []byte)
func (*TestRequest) WAFServerId ¶
func (this *TestRequest) WAFServerId() int64
func (*TestRequest) WAFSetCacheBody ¶
func (this *TestRequest) WAFSetCacheBody(bodyData []byte)
Click to show internal directories.
Click to hide internal directories.