blacklist

package
v0.0.0-...-c8b2685 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package blacklist implements a generic blacklist for strings. It is intended for use in the Downloader and Prefetcher to filter out undesirable URLs (e.g. Google Analytics, ad networks, ...).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blacklist

type Blacklist []blacklistItem

Blacklist is a list of regular expressions against which a string can be checked.

func DefaultList

func DefaultList() Blacklist

DefaultList creates a new Blacklist using the default list of patterns.

func NewBlacklist

func NewBlacklist(patterns []string) (Blacklist, error)

NewBlacklist creates a fresh Blacklist from the given list of patterns.

func (Blacklist) Len

func (bl Blacklist) Len() int

func (Blacklist) Less

func (bl Blacklist) Less(i, j int) bool

func (Blacklist) Match

func (bl Blacklist) Match(href string) bool

Match returns true if the given string is matched by one of the patterns comprising the Blacklist.

func (Blacklist) Swap

func (bl Blacklist) Swap(i, j int)

Jump to

Keyboard shortcuts

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