Documentation
¶
Index ¶
- type BrandVersion
- type ClientHints
- func (ch *ClientHints) GetApp() string
- func (ch *ClientHints) GetArchitecture() string
- func (ch *ClientHints) GetBitness() string
- func (ch *ClientHints) GetBrandList() map[string]string
- func (ch *ClientHints) GetBrandVersion() string
- func (ch *ClientHints) GetFormFactors() []string
- func (ch *ClientHints) GetModel() string
- func (ch *ClientHints) GetOperatingSystem() string
- func (ch *ClientHints) GetOperatingSystemVersion() string
- func (ch *ClientHints) IsMobile() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrandVersion ¶
BrandVersion represents a browser brand and its version.
type ClientHints ¶
type ClientHints struct {
// contains filtered or unexported fields
}
ClientHints represents the parsed client hints data
func Factory ¶
func Factory(headers map[string]interface{}) *ClientHints
Factory creates a ClientHints object from headers. It supports three header formats: 1. Standard HTTP headers: sec-ch-ua, sec-ch-ua-mobile, etc. 2. PHP $_SERVER style: HTTP_SEC_CH_UA, HTTP_SEC_CH_UA_MOBILE, etc. 3. JavaScript navigator.userAgentData API format:
- fullVersionList: []map[string]string{{"brand": "...", "version": "..."}, ...}
- mobile: bool
- platform: string
- platformVersion: string
- formFactors: []string
func New ¶
func New(headers http.Header) *ClientHints
New creates a ClientHints object from HTTP headers. This is a convenience wrapper around Factory for the common case where headers come from an HTTP request.
func (*ClientHints) GetApp ¶
func (ch *ClientHints) GetApp() string
func (*ClientHints) GetArchitecture ¶
func (ch *ClientHints) GetArchitecture() string
func (*ClientHints) GetBitness ¶
func (ch *ClientHints) GetBitness() string
func (*ClientHints) GetBrandList ¶
func (ch *ClientHints) GetBrandList() map[string]string
func (*ClientHints) GetBrandVersion ¶
func (ch *ClientHints) GetBrandVersion() string
func (*ClientHints) GetFormFactors ¶
func (ch *ClientHints) GetFormFactors() []string
func (*ClientHints) GetModel ¶
func (ch *ClientHints) GetModel() string
func (*ClientHints) GetOperatingSystem ¶
func (ch *ClientHints) GetOperatingSystem() string
func (*ClientHints) GetOperatingSystemVersion ¶
func (ch *ClientHints) GetOperatingSystemVersion() string
func (*ClientHints) IsMobile ¶
func (ch *ClientHints) IsMobile() bool
Click to show internal directories.
Click to hide internal directories.