Versions in this module Expand all Collapse all v1 v1.1.1 Feb 14, 2025 Changes in this version + type IPRange struct + Lower net.IP + Upper net.IP + func NewIPRange(lower net.IP, upper net.IP) IPRange + func (iprg *IPRange) Equals(iprange IPRange) bool + func (iprg IPRange) ContainsIP(ip net.IP) bool + func (iprg IPRange) ContainsIPRange(iprange IPRange) bool + func (iprg IPRange) ContainsIPString(ipstr string) bool + func (iprg IPRange) IsUpperOrLowerBoundary(ip net.IP) bool + type IPRanges []IPRange + func (iprgs *IPRanges) Add(ip net.IP) + func (iprgs *IPRanges) AddRange(lower net.IP, upper net.IP) + func (iprgs *IPRanges) AddString(ipstr string) error + func (iprgs *IPRanges) MergeOverlapping() + func (iprgs *IPRanges) RemoveAt(index int) + type IPRules struct + BlacklistedIPs IPRanges + WhitelistedIPs IPRanges + func (iprl *IPRules) Blacklist(ip string) error + func (iprl *IPRules) BlacklistCIDR(rawIPCIDR string) error + func (iprl *IPRules) BlacklistRange(rawIPRange string) error + func (iprl *IPRules) ParseRules(whitelist []string, blacklist []string) + func (iprl *IPRules) Whitelist(ip string) error + func (iprl *IPRules) WhitelistCIDR(rawIPCIDR string) error + func (iprl *IPRules) WhitelistRange(rawIPRange string) error + type PortRange struct + Lower uint16 + Upper uint16 + func NewPortRange(lower uint16, upper uint16) PortRange + func (prg *PortRange) Equals(portRange PortRange) bool + func (prg PortRange) ContainsPort(port uint16) bool + func (prg PortRange) ContainsPortRange(portRange PortRange) bool + func (prg PortRange) IsUpperOrLowerBoundary(port uint16) bool + type PortRanges []PortRange + func (prgs *PortRanges) Add(port uint16) + func (prgs *PortRanges) AddRange(lower uint16, upper uint16) + func (prgs *PortRanges) MergeOverlapping() + func (prgs *PortRanges) RemoveAt(index int) + type PortRules struct + BlacklistedPorts PortRanges + WhitelistedPorts PortRanges + func (prls *PortRules) Blacklist(port string) error + func (prls *PortRules) BlacklistRange(rawPortRange string) error + func (prls *PortRules) ParseRules(whitelist []string, blacklist []string) + func (prls *PortRules) Whitelist(port string) error + func (prls *PortRules) WhitelistRange(rawPortRange string) error