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 Browser ¶
type Browser struct { Name BrowserName Version Version }
type BrowserName ¶
type BrowserName int
BrowserName (int) returns a constant.
const ( BrowserUnknown BrowserName = iota BrowserChrome BrowserIE BrowserSafari BrowserFirefox BrowserAndroid BrowserOpera BrowserBlackberry BrowserUCBrowser BrowserSilk BrowserNokia BrowserNetFront BrowserQQ BrowserMaxthon BrowserSogouExplorer BrowserSpotify BrowserNintendo 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
func (BrowserName) StringTrimPrefix ¶
func (b BrowserName) StringTrimPrefix() string
StringTrimPrefix is like String() but trims the "Browser" prefix
type DeviceType ¶
type DeviceType int
DeviceType (int) returns a constant.
const ( DeviceUnknown DeviceType = iota DeviceComputer DeviceTablet DevicePhone DeviceConsole DeviceWearable DeviceTV DeviceMediaHub )
A complete list of supported devices in the form of constants.
func (DeviceType) String ¶
func (i DeviceType) String() string
func (DeviceType) StringTrimPrefix ¶
func (d DeviceType) StringTrimPrefix() string
StringTrimPrefix is like String() but trims the "Device" prefix
type OSName ¶
type OSName int
OSName (int) returns a constant.
const ( OSUnknown OSName = iota OSWindowsPhone OSWindows OSMacOSX OSiOS OSAndroid OSBlackberry OSChromeOS OSKindle OSWebOS OSLinux OSPlaystation OSXbox OSNintendo OSBot )
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.
func (OSName) StringTrimPrefix ¶
StringTrimPrefix is like String() but trims the "OS" prefix
type Platform ¶
type Platform int
Platform (int) returns a constant.
const ( PlatformUnknown Platform = iota PlatformWindows PlatformMac PlatformLinux PlatformiPad PlatformiPhone PlatformiPod PlatformBlackberry PlatformWindowsPhone PlatformPlaystation PlatformXbox PlatformNintendo PlatformBot )
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 (Platform) StringTrimPrefix ¶
StringTrimPrefix is like String() but trims the "Platform" prefix