Documentation ¶
Overview ¶
Package uasurfer provides fast and reliable abstraction of HTTP User-Agent strings. The philosophy is to identify technologies that holds >1% market share, and to avoid expending resources and accuracy on guessing at esoteric UA strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseUserAgent ¶
ParseUserAgent is the same as Parse, but populates the supplied UserAgent. It is the caller's responsibility to call Reset() on the UserAgent before passing it to this function.
Types ¶
type BrowserID ¶
type BrowserID uint8
BrowserID (uint8) returns a constant.
const ( BrowserUnknown BrowserID = 0 BrowserChrome BrowserID = 1 BrowserIE BrowserID = 3 BrowserSafari BrowserID = 4 BrowserFirefox BrowserID = 5 BrowserAndroid BrowserID = 6 BrowserOpera BrowserID = 7 BrowserBlackberry BrowserID = 8 BrowserUCBrowser BrowserID = 9 BrowserSilk BrowserID = 10 BrowserNokia BrowserID = 11 BrowserNetFront BrowserID = 12 BrowserQQ BrowserID = 13 BrowserMaxthon BrowserID = 14 BrowserSogouExplorer BrowserID = 15 BrowserSpotify BrowserID = 16 BrowserNintendo BrowserID = 17 BrowserSamsung BrowserID = 18 BrowserYandex BrowserID = 19 BrowserCocCoc BrowserID = 20 BrowserBot BrowserID = 21 // Bot list begins here BrowserMSOutlook BrowserID = 22 BrowserSuperHuman BrowserID = 23 )
A complete list of supported web browsers in the form of constants.
type DeviceID ¶
type DeviceID int8
DeviceID (uint8) returns a constant.
type OS ¶
type OS struct { Platform PlatformID Name OSID Version Version }
type OSID ¶
type OSID uint8
OSID (int) returns a constant.
const ( OSUnknown OSID = 0 OSWindowsPhone OSID = 1 OSWindows OSID = 2 OSMacOSX OSID = 3 OSiOS OSID = 4 OSAndroid OSID = 5 OSBlackberry OSID = 6 OSChromeOS OSID = 7 OSKindle OSID = 8 OSWebOS OSID = 9 OSLinux OSID = 10 OSPlaystation OSID = 11 OSXbox OSID = 12 OSNintendo OSID = 13 )
A complete list of supported OSes in the form of constants. For handling particular versions of operating systems (e.g. Windows 2000), see the README.md file.
type PlatformID ¶
type PlatformID uint8
Platform (int) returns a constant.
const ( PlatformUnknown PlatformID = 0 PlatformWindows PlatformID = 1 PlatformMac PlatformID = 2 PlatformLinux PlatformID = 3 PlatformiPad PlatformID = 4 PlatformiPhone PlatformID = 5 PlatformiPod PlatformID = 6 PlatformBlackberry PlatformID = 7 PlatformWindowsPhone PlatformID = 8 PlatformPlaystation PlatformID = 9 PlatformXbox PlatformID = 10 PlatformNintendo PlatformID = 11 PlatformAndroid PlatformID = 13 )
A complete list of supported platforms in the form of constants. Many OSes report their true platform, such as Android OS being Linux platform.
func (PlatformID) String ¶
func (b PlatformID) String() string