Documentation
¶
Overview ¶
Package ip implements utility routines to manipulate IP and CIDR. It allows searching an IP on a list, and find if an IP is part of a list of CIDR.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRemoteIP ¶
GetRemoteIP It returns the first IP that is not in the pool, or the empty string otherwise.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker allows to check that addresses are in a trusted IPs.
func NewChecker ¶
NewChecker builds a new Checker given a list of CIDR-Strings to trusted IPs.
type PoolStrategy ¶
type PoolStrategy struct {
Checker *Checker
}
PoolStrategy is a strategy based on an IP Checker. It allows to check whether addresses are in a given pool of IPs.
Click to show internal directories.
Click to hide internal directories.