vars

package
v0.0.0-...-d13c16c Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

type Browser struct {
	Name    BrowserName
	Version version.Version
}

Browser contains the name and version of the browser

type BrowserName

type BrowserName int

BrowserName (int) returns a constant.

const (
	BrowserUnknown BrowserName = iota
	BrowserChrome
	BrowserChromium
	BrowserIE
	BrowserEdge
	BrowserSafari
	BrowserFirefox
	BrowserAndroid
	BrowserOpera
	BrowserUCBrowser
	BrowserQQ
	BrowserSamsung
	BrowserYandex
	BrowserCocCoc
	BrowserBot // Bot list begins here
	BrowserAppleBot
	BrowserBaiduBot
	BrowserBingBot
	BrowserDuckDuckGoBot
	BrowserFacebookBot
	BrowserGoogleBot
	BrowserLinkedInBot
	BrowserMsnBot
	BrowserPingdomBot
	BrowserTwitterBot
	BrowserYandexBot
	BrowserCocCocBot
	BrowserYahooBot // Bot list ends here
)

A complete list of supported web browsers in the form of constants.

func (BrowserName) String

func (i BrowserName) String() string

type DeviceType

type DeviceType int

DeviceType (int) returns a constant.

const (
	DeviceUnknown DeviceType = iota
	DeviceComputer
	DeviceTablet
	DevicePhone
	DeviceConsole
	DeviceTV
)

A complete list of supported device types in the form of constants.

func (DeviceType) String

func (i DeviceType) String() string

type OS

type OS struct {
	Platform     Platform
	Name         OSName
	Version      version.Version
	VersionAlias string
}

OS contains the name, version and platform of the OS

func (*OS) String

func (o *OS) String() string

String returns the name of the OS in human readable form (e.g. 'macOS Catalina 10.15')

type OSName

type OSName int

OSName (int) returns a constant.

const (
	OSUnknown OSName = iota
	OSWindows
	OSMacOS
	OSiOS
	OSAndroid
	OSChromeOS
	OSLinux
	OSBot
)

A complete list of supported OS in the form of constants.

func (OSName) String

func (i OSName) String() string

type Platform

type Platform int

Platform (int) returns a constant.

const (
	PlatformUnknown Platform = iota
	PlatformWindows
	PlatformMac
	PlatformLinux
	PlatformiPad
	PlatformiPhone
	PlatformiPod
	PlatformBot
)

A complete list of supported platforms in the form of constants. Many OS report their true platform, such as Android OS being Linux platform.

func (Platform) String

func (i Platform) String() string

type UserAgent

type UserAgent struct {
	Browser    Browser
	OS         OS
	DeviceType DeviceType
}

UserAgent stores the info about the browser, OS and device type

func (*UserAgent) IsBot

func (ua *UserAgent) IsBot() bool

IsBot returns true if the Browser, OS or Platform is reported as "Bot"

Jump to

Keyboard shortcuts

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