Documentation
¶
Index ¶
- Constants
- type UserAgent
- func (ua UserAgent) IsAndroid() bool
- func (ua UserAgent) IsChrome() bool
- func (ua UserAgent) IsEdge() bool
- func (ua UserAgent) IsFacebookbot() bool
- func (ua UserAgent) IsFirefox() bool
- func (ua UserAgent) IsGooglebot() bool
- func (ua UserAgent) IsIOS() bool
- func (ua UserAgent) IsInternetExplorer() bool
- func (ua UserAgent) IsLinux() bool
- func (ua UserAgent) IsMacOS() bool
- func (ua UserAgent) IsOpera() bool
- func (ua UserAgent) IsOperaMini() bool
- func (ua UserAgent) IsSafari() bool
- func (ua UserAgent) IsTwitterbot() bool
- func (ua UserAgent) IsWindows() bool
Constants ¶
View Source
const ( Windows = "Windows" WindowsPhone = "Windows Phone" Android = "Android" MacOS = "macOS" IOS = "iOS" Linux = "Linux" ChromeOS = "CrOS" Opera = "Opera" OperaMini = "Opera Mini" OperaTouch = "Opera Touch" Chrome = "Chrome" Firefox = "Firefox" InternetExplorer = "Internet Explorer" Safari = "Safari" Edge = "Edge" Vivaldi = "Vivaldi" Googlebot = "Googlebot" Twitterbot = "Twitterbot" FacebookExternalHit = "facebookexternalhit" Applebot = "Applebot" )
Constants for browsers and operating systems for easier comparison
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserAgent ¶
type UserAgent struct {
Name string
Version string
OS string
OSVersion string
Device string
Mobile bool
Tablet bool
Desktop bool
Bot bool
URL string
String string
}
UserAgent struct containing all data extracted from parsed user-agent string
func (UserAgent) IsFacebookbot ¶
IsFacebookbot shorthand function to check if Name == FacebookExternalHit
func (UserAgent) IsGooglebot ¶
IsGooglebot shorthand function to check if Name == Googlebot
func (UserAgent) IsInternetExplorer ¶
IsInternetExplorer shorthand function to check if Name == Internet Explorer
func (UserAgent) IsOperaMini ¶
IsOperaMini shorthand function to check if Name == Opera Mini
func (UserAgent) IsTwitterbot ¶
IsTwitterbot shorthand function to check if Name == Twitterbot
Click to show internal directories.
Click to hide internal directories.