Documentation ¶
Index ¶
- Constants
- func BetweenMatch(addr net.IP, block string) bool
- func BytesToMAC(mac []byte) string
- func CIDRMatch(ip net.IP, cidr string) bool
- func CheckConnect(host string) error
- func GetClientIP(r *http.Request) string
- func GetLocalAddr() string
- func GetLocalHostName() string
- func GetLocalIP() string
- func GetMacAddr() (addr string)
- func IPBetween(from net.IP, to net.IP, userIp net.IP) bool
- func IPInRange(ip string, list []string) bool
- func IPToInt(ip string) uint32
- func IntToIP(ip uint32) string
- func Lookup(host string) error
- func MACToByte(mac string) []byte
- func WildcardMatch(userIP net.IP, wildcardIP string) bool
Constants ¶
View Source
const ( HeaderXRealIP = "X-Real-Ip" HeaderXForwardedFor = "X-Forwarded-For" )
Variables ¶
This section is empty.
Functions ¶
func BetweenMatch ¶
BetweenMatch checks if ip belongs to specific IP Start-End range (ip-ip)
func BytesToMAC ¶
BytesToMAC converts a binary representation of a MAC address to string representation
func CheckConnect ¶
func GetClientIP ¶
func GetLocalAddr ¶
func GetLocalAddr() string
func GetLocalHostName ¶
func GetLocalHostName() string
GetLocalHostName returns the local hostname or the local IP if the hostname cannot be resolved
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.