system

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Procs = func() int {
	procs := runtime.GOMAXPROCS(0)
	if procs < 4 {
		return 4
	}
	return procs
}()
View Source
var UserAgentLength = len(UserAgents)
View Source
var UserAgents = []string{
	"",
	"curl/7.1.2",
	"curl/7.2.3",
	"curl/7.1.3",
	"curl/7.1.4",
	"curl/7.1.5",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/99.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/101.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/102.0",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/99.0",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/101.0",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/102.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.6743.241 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.6743.241 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.6743.241 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.6743.241 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Windows NT 11.0; Win64; x64; rv:100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.3325.162 Safari/537.36",
	"Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3239.83 Mobile Safari/537.36",
	"Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.3239.83 Mobile Safari/537.36",
	"Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.3239.83 Mobile Safari/537.36",
	"Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.3239.83 Mobile Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.2272.89 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.2272.89 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.2272.89 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.2272.89 Safari/537.36",
}

Functions

func AbsDomain added in v0.3.6

func AbsDomain(domain string) string

AbsDomain a character string which represents a complete domain name (often called "absolute"). For example, "poneria.ISI.EDU."

func CheapNowNano added in v0.3.6

func CheapNowNano() int64

Nanotime is runtime.nanotime.

func GetScheme added in v0.3.6

func GetScheme(rawURL string) (scheme, path string, err error)

Maybe rawURL is of the form scheme:path. (Scheme must be [a-zA-Z][a-zA-Z0-9+.-]*) If so, return scheme, path; else return "", rawURL.

copy from net/url.getScheme

func IsDomainName added in v0.3.6

func IsDomainName(string) bool

func LookupStaticAddr added in v0.3.6

func LookupStaticAddr(ip net.IP) []string

func LookupStaticHost added in v0.3.6

func LookupStaticHost(host string) ([]netip.Addr, string)

func NowUnix added in v0.3.6

func NowUnix() int64

func NowUnixMicro added in v0.3.6

func NowUnixMicro() int64

func NowUnixNano added in v0.3.6

func NowUnixNano() int64

func RelDomain added in v0.3.6

func RelDomain(domain string) string

RelDomain a character string that represents the starting labels of a domain name which is incomplete, and should be completed by local software using knowledge of the local domain (often called "relative"). For example, "poneria" used in the ISI.EDU domain.

Types

type Hosts added in v0.3.7

type Hosts struct {
	ByAddr map[netip.Addr][]string
	ByName map[string]byName
}

Jump to

Keyboard shortcuts

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