Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientIP ¶
GetClientIP obtains the perceived end-user IP address from headers if p != nil else from req.RemoteAddr.
func GetClientString ¶
GetClientString obtains the human readable string of the remote IP and optionally the real client IP if available
func GetRealClientIPParser ¶
func GetRealClientIPParser(headerKey string) (ipapi.RealClientIPParser, error)
func ParseIPNet ¶
Types ¶
type NetSet ¶
type NetSet struct {
// contains filtered or unexported fields
}
Fast lookup table for intersection of a single IP address within a collection of CIDR networks.
Supports 4-byte (IPv4) and 16-byte (IPv6) networks.
Provides O(1) best-case, O(log(n)) worst-case performance. In practice netmasks included will generally only be of standard lengths: - /8, /16, /24, and /32 for IPv4 - /64 and /128 for IPv6. As a result, typical lookup times will lean closer to best-case rather than worst-case even when most of the internet is included.