hostmatcher

package
v1.15.10 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const MatchBuiltinAll = "*"

MatchBuiltinAll all hosts are matched

View Source
const MatchBuiltinExternal = "external"

MatchBuiltinExternal A valid non-private unicast IP, all hosts on public internet are matched

View Source
const MatchBuiltinLoopback = "loopback"

MatchBuiltinLoopback 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included.

View Source
const MatchBuiltinPrivate = "private"

MatchBuiltinPrivate RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostMatchList

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

HostMatchList is used to check if a host or IP is in a list. If you only need to do wildcard matching, consider to use modules/matchlist

func ParseHostMatchList

func ParseHostMatchList(hostList string) *HostMatchList

ParseHostMatchList parses the host list HostMatchList

func (*HostMatchList) MatchesHostOrIP

func (hl *HostMatchList) MatchesHostOrIP(host string, ip net.IP) bool

MatchesHostOrIP checks if the host or IP matches an allow/deny(block) list

Jump to

Keyboard shortcuts

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