netutil

package
v0.2.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package netutil is common network utils for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIP

func ClientIP(req *http.Request) string

ClientIP returns the IP address of client.

func DeDuplicateIPs added in v0.1.23

func DeDuplicateIPs(ips []net.IP) []net.IP

DeDuplicateIPs De-duplicate the given IPs.

func IPString2Uint

func IPString2Uint(ip string) uint

IPString2Uint converts the given IP string to an uint value.

func IsIPV4

func IsIPV4(ip string) bool

IsIPV4 reports whether the given IP is ipv4.

func LocalIP

func LocalIP() (net.IP, error)

LocalIP returns the local IP address.

func Uint2IPString

func Uint2IPString(i uint) string

Uint2IPString converts the given uint value to IP string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL