rule

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrForbiddenHeader             = errors.New("forbidden header")
	ErrInvalidRemoveheaderModifier = errors.New("invalid removeheader modifier")
)

Functions

This section is empty.

Types

type Rule

type Rule struct {
	// string representation
	RawRule string
	// FilterName is the name of the filter that the rule belongs to.
	FilterName *string
	// contains filtered or unexported fields
}

Rule represents modifiers of a rule.

func (*Rule) ModifyReq

func (rm *Rule) ModifyReq(req *http.Request) (modified bool)

ModifyReq modifies a request. Returns true if the request was modified.

func (*Rule) ModifyRes

func (rm *Rule) ModifyRes(res *http.Response) (modified bool)

ModifyRes modifies a response. Returns true if the response was modified.

func (*Rule) ParseModifiers

func (rm *Rule) ParseModifiers(modifiers string) error

func (*Rule) ShouldBlockReq

func (rm *Rule) ShouldBlockReq(*http.Request) bool

ShouldBlockReq returns true if the request should be blocked.

func (*Rule) ShouldMatchReq

func (rm *Rule) ShouldMatchReq(req *http.Request) bool

ShouldMatchReq returns true if the rule should match the request.

func (*Rule) ShouldMatchRes

func (rm *Rule) ShouldMatchRes(res *http.Response) bool

ShouldMatchRes returns true if the rule should match the response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL