setting

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHROME            = "chrome"
	INTERNET_EXPLORER = "internet-explorer"
	FIREFOX           = "firefox"
	SAFARI            = "safari"

	ANDROID  = "android"
	MAC_OS_X = "mac-os-x"
	IOS      = "ios"
	LINUX    = "linux"
	WINDOWS  = "windows"

	IPHONE = "iphone"
	IPAD   = "ipad"

	COMPUTER = "computer"
	MOBILE   = "mobile"
)
View Source
const (
	VERSION = "0.2.0"

	BROWSER_URL            = "https://developers.whatismybrowser.com/useragents/explore/%s/%s/%d"
	BROWSER_MAX_PAGE       = 5
	BROWSER_ALLOW_MAX_PAGE = 8

	CACHE_VERSION = "0.2.0"
	CACHE_URL     = "https://raw.githubusercontent.com/spider-com/fake-useragent/v0.2.0/static/"

	HTTP_TIMEOUT         = 5 * time.Second
	HTTP_DELAY           = 100 * time.Millisecond
	HTTP_ALLOW_MIN_DELAY = 100 * time.Millisecond

	TEMP_FILE_NAME      = "fake_useragent_%s.json"
	TEMP_FILE_TEST_NAME = "fake_useragent_test_%s.json"
)

Variables

View Source
var (
	BrowserUserAgentMaps = map[string][]string{
		"software_name": {
			CHROME,
			INTERNET_EXPLORER,
			FIREFOX,
			SAFARI,
		},
		"operating_system_name": {
			ANDROID,
			MAC_OS_X,
			IOS,
			LINUX,
			WINDOWS,
		},
		"operating_platform": {
			IPHONE,
			IPAD,
		},
		"hardware_type_specific": {
			COMPUTER,
			MOBILE,
		},
	}
)

Functions

func GetDelay

func GetDelay(delay time.Duration) time.Duration

func GetMaxPage

func GetMaxPage(maxPage int) int

func GetTimeout

func GetTimeout(timeout time.Duration) time.Duration

Types

This section is empty.

Jump to

Keyboard shortcuts

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