blocklist

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParsers

func GetParsers() map[string]Parser

GetParsers returns predefined parsers for common blocklist formats

func ParseLine

func ParseLine(line, listName string) string

ParseLine extracts IP/CIDR from a line using the appropriate parser

func ValidateIP

func ValidateIP(ipStr string) bool

ValidateIP checks if the extracted string is a valid IP or CIDR

Types

type Parser

type Parser struct {
	Name    string
	Pattern *regexp.Regexp
	Extract func(matches []string) string
}

Parser defines how to extract IPs from different blocklist formats

Jump to

Keyboard shortcuts

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