networkrules

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockInfo added in v0.12.0

type BlockInfo struct {
	Rule          string
	FilterList    string
	WhitelistPort int
}

type NetworkRules

type NetworkRules struct {
	// contains filtered or unexported fields
}

func NewNetworkRules

func NewNetworkRules() *NetworkRules

func (*NetworkRules) CreateBlockPageResponse added in v0.12.0

func (nr *NetworkRules) CreateBlockPageResponse(req *http.Request, appliedRules []rule.Rule, whitelistPort int) (*http.Response, error)

func (*NetworkRules) CreateBlockResponse

func (nr *NetworkRules) CreateBlockResponse(req *http.Request) *http.Response

CreateBlockResponse creates a response for a blocked request.

func (*NetworkRules) CreateRedirectResponse

func (nr *NetworkRules) CreateRedirectResponse(req *http.Request, to string) *http.Response

CreateRedirectResponse creates a response for a redirected request.

func (*NetworkRules) ModifyReq

func (nr *NetworkRules) ModifyReq(req *http.Request) (appliedRules []rule.Rule, shouldBlock bool, redirectURL string)

func (*NetworkRules) ModifyRes

func (nr *NetworkRules) ModifyRes(req *http.Request, res *http.Response) ([]rule.Rule, error)

func (*NetworkRules) ParseRule

func (nr *NetworkRules) ParseRule(rawRule string, filterName *string) (isException bool, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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