Documentation
¶
Overview ¶
Package bogon provides a simply interface to check if an IP address is a "bogon" IP (an internal IP that should not be hitting external services), or a custom specified range of CIDR's.
Note that you can use New to check your own ranges.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRanges ¶
DefaultRanges returns the default list of bogon IP CIDRs.
Types ¶
type Bogon ¶
type Bogon struct {
// contains filtered or unexported fields
}
Bogon is a helper utility to use your own IP ranges.
func New ¶
New returns a new Bogon instance. Use this if you have your own CIDR ranges that you would like to check. An error is returned if a nil list is supplied or if one of the supplied CIDR's is invalid.
func (*Bogon) Is ¶
Is checks if the IP address is within the custom Bogon IP ranges specified during the creation of the Bogon instance. representation is non-nil if the match is a success, and it contains the string representation of the CIDR notation that it matched.