Device
type Device struct { // contains filtered or unexported fields}Methods
Brand
View sourcefunc (d *Device) Brand() stringBrand returns the brand of the client device, possibly different from the manufacturer of that device.
Returns
HWType
View sourcefunc (d *Device) HWType() stringHWType returns a string representation of the primary client platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging.
Returns
Identified
View sourcefunc (d *Device) Identified() boolUserAgentIdentified returns true if the client device was successfully identified
Returns
IsDesktop
View sourcefunc (d *Device) IsDesktop() boolIsDesktop returns true if the client device is a desktop web browser.
Returns
IsDownloader
View sourcefunc (d *Device) IsDownloader() boolUserAgentIsDownloader returns true if the client device is a downloader
Returns
IsEReader
View sourcefunc (d *Device) IsEReader() boolIsEReader returns true if the client device is a reading device (like a Kindle).
Returns
IsFeedreader
View sourcefunc (d *Device) IsFeedreader() boolUserAgentIsFeedreader returns true if the client device is a feed reader
Returns
IsGameConsole
View sourcefunc (d *Device) IsGameConsole() boolIsGameConsole returns true if the client device is a video game console (like a PlayStation or Xbox).
Returns
IsMediaPlayer
View sourcefunc (d *Device) IsMediaPlayer() boolIsMediaPlayer returns true if the client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).
Returns
IsMobile
View sourcefunc (d *Device) IsMobile() boolIsMobile returns true if the client device is a mobile phone.
Returns
IsSmartTV
View sourcefunc (d *Device) IsSmartTV() boolIsSmartTV returns true if the client device is a smart TV.
Returns
IsTablet
View sourcefunc (d *Device) IsTablet() boolIsTablet returns true if the client device is a tablet (like an iPad).
Returns
IsTouchscreen
View sourcefunc (d *Device) IsTouchscreen() boolIsTouchscreen returns true if the client device's screen is touch sensitive.
Returns
IsTVPlayer
View sourcefunc (d *Device) IsTVPlayer() boolIsTVPlayer returns true if the client device is a set-top box or other TV player (like a Roku or Apple TV).
Returns
Model
View sourcefunc (d *Device) Model() stringModel returns the model of the client device.
Returns
Name
View sourcefunc (d *Device) Name() stringName returns the name of the client device.
Returns
UserAgentBotName
View sourcefunc (d *Device) UserAgentBotName() stringUserAgentBotName returns the bot name (if the user agent is a bot)
Returns
UserAgentIsBot
View sourcefunc (d *Device) UserAgentIsBot() boolUserAgentIsBot returns true if the client device is a bot
Returns
UserAgentMajor
View sourcefunc (d *Device) UserAgentMajor() stringUserAgentMajor returns the major version of the user agent
Returns
UserAgentMinor
View sourcefunc (d *Device) UserAgentMinor() stringUserAgentMinor returns the minor version of the user agent
Returns
UserAgentName
View sourcefunc (d *Device) UserAgentName() stringUserAgentName returns the name of the user agent
Returns
UserAgentPatch
View sourcefunc (d *Device) UserAgentPatch() stringUserAgentPatch returns the patch level version of the user agent
Returns