filtertest

package
v0.0.0-...-b6e3791 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package filtertest contains common constants and utilities for the internal filtering packages.

Index

Constants

View Source
const BlockRule = "|" + ReqHost + "^"

BlockRule is the common blocking rule for filtering tests that blocks ReqHost.

View Source
const CacheTTL = 1 * time.Hour

CacheTTL is the common long cache-TTL for filtering tests.

View Source
const FilterMaxSize = 640 * uint64(datasize.KB)

FilterMaxSize is the maximum size of the downloadable rule-list for filtering tests.

View Source
const ReqFQDN = ReqHost + "."

ReqFQDN is the common request FQDN for filtering tests.

View Source
const ReqHost = "www.host.example"

ReqHost is the common request host for filtering tests.

View Source
const ServerName = "testServer/1.0"

ServerName is the common server name for filtering tests.

View Source
const Staleness = 1 * time.Hour

Staleness is the common long staleness for filtering tests.

View Source
const Timeout = 1 * time.Second

Timeout is the common timeout for filtering tests.

Variables

View Source
var RemoteIP = netip.MustParseAddr("1.2.3.4")

RemoteIP is the common client IP for filtering tests

Functions

func PrepareRefreshable

func PrepareRefreshable(
	tb testing.TB,
	reqCh chan<- struct{},
	text string,
	code int,
) (cachePath string, srvURL *url.URL)

PrepareRefreshable launches an HTTP server serving the given text and code, as well as creates a cache file. If code is zero, the server isn't started. If reqCh not nil, a signal is sent every time the server is called. The server uses ServerName as the value of the Server header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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