Structin devicecompute-sdk-go v1.11.0View source
type Device struct {
// contains filtered or unexported fields
}

Methods

func (d *Device) Brand() string

Brand returns the brand of the client device, possibly different from the manufacturer of that device.

Returns

string
func (d *Device) HWType() string

HWType 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

string

Identified

View source
func (d *Device) Identified() bool

UserAgentIdentified returns true if the client device was successfully identified

Returns

bool

IsDesktop

View source
func (d *Device) IsDesktop() bool

IsDesktop returns true if the client device is a desktop web browser.

Returns

bool

IsDownloader

View source
func (d *Device) IsDownloader() bool

UserAgentIsDownloader returns true if the client device is a downloader

Returns

bool

IsEReader

View source
func (d *Device) IsEReader() bool

IsEReader returns true if the client device is a reading device (like a Kindle).

Returns

bool

IsFeedreader

View source
func (d *Device) IsFeedreader() bool

UserAgentIsFeedreader returns true if the client device is a feed reader

Returns

bool

IsGameConsole

View source
func (d *Device) IsGameConsole() bool

IsGameConsole returns true if the client device is a video game console (like a PlayStation or Xbox).

Returns

bool

IsMediaPlayer

View source
func (d *Device) IsMediaPlayer() bool

IsMediaPlayer returns true if the client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).

Returns

bool

IsMobile

View source
func (d *Device) IsMobile() bool

IsMobile returns true if the client device is a mobile phone.

Returns

bool

IsSmartTV

View source
func (d *Device) IsSmartTV() bool

IsSmartTV returns true if the client device is a smart TV.

Returns

bool

IsTablet

View source
func (d *Device) IsTablet() bool

IsTablet returns true if the client device is a tablet (like an iPad).

Returns

bool

IsTouchscreen

View source
func (d *Device) IsTouchscreen() bool

IsTouchscreen returns true if the client device's screen is touch sensitive.

Returns

bool

IsTVPlayer

View source
func (d *Device) IsTVPlayer() bool

IsTVPlayer returns true if the client device is a set-top box or other TV player (like a Roku or Apple TV).

Returns

bool
func (d *Device) Model() string

Model returns the model of the client device.

Returns

string
func (d *Device) Name() string

Name returns the name of the client device.

Returns

string

UserAgentBotName

View source
func (d *Device) UserAgentBotName() string

UserAgentBotName returns the bot name (if the user agent is a bot)

Returns

string

UserAgentIsBot

View source
func (d *Device) UserAgentIsBot() bool

UserAgentIsBot returns true if the client device is a bot

Returns

bool

UserAgentMajor

View source
func (d *Device) UserAgentMajor() string

UserAgentMajor returns the major version of the user agent

Returns

string

UserAgentMinor

View source
func (d *Device) UserAgentMinor() string

UserAgentMinor returns the minor version of the user agent

Returns

string

UserAgentName

View source
func (d *Device) UserAgentName() string

UserAgentName returns the name of the user agent

Returns

string

UserAgentPatch

View source
func (d *Device) UserAgentPatch() string

UserAgentPatch returns the patch level version of the user agent

Returns

string