util

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: GPL-3.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DestIP string
View Source
var DisableMPLS = GetenvDefault("NEXTTRACE_DISABLEMPLS", "")
View Source
var EnableHidDstIP = GetenvDefault("NEXTTRACE_ENABLEHIDDENDSTIP", "")
View Source
var EnvIPInfoLocalPath = GetenvDefault("NEXTTRACE_IPINFOLOCALPATH", "")
View Source
var EnvToken = GetenvDefault("NEXTTRACE_TOKEN", "")
View Source
var FastIpCache = ""
View Source
var PowProviderParam = ""
View Source
var RdnsCache sync.Map
View Source
var Uninterrupted = GetenvDefault("NEXTTRACE_UNINTERRUPTED", "")
View Source
var UserAgent = fmt.Sprintf("NextTrace %s/%s/%s", config.Version, runtime.GOOS, runtime.GOARCH)

Functions

func Aliyun

func Aliyun() *net.Resolver

func Cloudflare

func Cloudflare() *net.Resolver

func DNSSB

func DNSSB() *net.Resolver

func Dnspod

func Dnspod() *net.Resolver

func DomainLookUp

func DomainLookUp(host string, ipVersion string, dotServer string, disableOutput bool) (net.IP, error)

func GetFastIP

func GetFastIP(domain string, port string, enableOutput bool) string

func GetHostAndPort

func GetHostAndPort() (host string, port string)

func GetICMPResponsePayload

func GetICMPResponsePayload(data []byte) ([]byte, error)

func GetIPHeaderLength

func GetIPHeaderLength(data []byte) (int, error)

func GetPowProvider

func GetPowProvider() string

func GetProxy

func GetProxy() *url.URL

func GetTCPSeq

func GetTCPSeq(data []byte) uint32

func GetUDPSrcPort

func GetUDPSrcPort(data []byte) uint16

func GetenvDefault

func GetenvDefault(key, defVal string) string

func Google

func Google() *net.Resolver

func HideIPPart added in v1.2.6

func HideIPPart(ip string) string

func LocalIPPort

func LocalIPPort(dstip net.IP) (net.IP, int)

LocalIPPort get the local ip and port based on our destination ip

func LocalIPPortv6

func LocalIPPortv6(dstip net.IP) (net.IP, int)

func LookupAddr

func LookupAddr(addr string) ([]string, error)

func StringInSlice

func StringInSlice(val string, list []string) bool

Types

type ResponseInfo

type ResponseInfo struct {
	IP      string
	Latency string
	Content string
}

Jump to

Keyboard shortcuts

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