Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPBlacklist ¶
type IPBlacklist struct {
// contains filtered or unexported fields
}
IPBlacklist is a blacklist that matches IP addresses against a list of networks.
func DefaultIPBlacklist ¶
func DefaultIPBlacklist() *IPBlacklist
DefaultIPBlacklist returns a new IPBlacklist created from the list of reserved networks.
func MakeIPBlacklist ¶
func MakeIPBlacklist(networks []string) (*IPBlacklist, error)
MakeIPBlacklist creates an IPBlacklist from the list of networks given in CIDR notation.
func (*IPBlacklist) Len ¶
func (bl *IPBlacklist) Len() int
func (*IPBlacklist) Less ¶
func (bl *IPBlacklist) Less(a, b int) bool
func (*IPBlacklist) Matches ¶
func (bl *IPBlacklist) Matches(x string) bool
Matches returns true if the given IP address is a member of any of the networks in the blacklist.
func (*IPBlacklist) MatchesIP ¶
func (bl *IPBlacklist) MatchesIP(x net.IP) bool
MatchesIP returns true if the given IP address is a member of any of the networks in the blacklist.
func (*IPBlacklist) Swap ¶
func (bl *IPBlacklist) Swap(a, b int)
type IPBlacklistItem ¶
IPBlacklistItem is a blacklist item that matches IP addresses against a network.
type NameBlacklist ¶
type NameBlacklist struct {
// contains filtered or unexported fields
}
NameBlacklist is a blacklist that matches host names against a list of NameBlacklistItems.
func DefaultNameBlacklist ¶
func DefaultNameBlacklist() *NameBlacklist
DefaultNameBlacklist returns a new NameBlacklist created from the default list of names.
func MakeNameBlacklist ¶
func MakeNameBlacklist(patterns []string) (*NameBlacklist, error)
MakeNameBlacklist creates a new NameBlacklist from the list of patterns.
func (*NameBlacklist) Len ¶
func (bl *NameBlacklist) Len() int
func (*NameBlacklist) Less ¶
func (bl *NameBlacklist) Less(a, b int) bool
func (*NameBlacklist) Matches ¶
func (bl *NameBlacklist) Matches(x string) bool
Matches returns true if the given string matches any of the patterns in the blacklist.
func (*NameBlacklist) Swap ¶
func (bl *NameBlacklist) Swap(a, b int)
type NameBlacklistItem ¶
NameBlacklistItem is a blacklist item that matches hostnames.