Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a filter for URLs that is capable of Adblock-style filter lists and hosts rules and matching URLs against them.
The filter is safe for concurrent use.
func NewFilter ¶
func NewFilter(config config, ruleMatcher ruleMatcher, exceptionRuleMatcher ruleMatcher, eventsEmitter filterEventsEmitter) (*Filter, error)
NewFilter creates and initializes a new filter.
func (*Filter) AddRules ¶
AddRules parses the rules from the given reader and adds them to the filter.
func (*Filter) HandleRequest ¶
HandleRequest handles the given request by matching it against the filter rules. If the request should be blocked, it returns a response that blocks the request. If the request should be modified, it modifies it in-place.
Click to show internal directories.
Click to hide internal directories.