Documentation
¶
Index ¶
- Constants
- func ExtractMajorVersion(version string) int
- func Filter[E any](s *[]E, f func(E) bool) []E
- type FilterBy
- func (c *FilterBy) Browser(f ...string) *FilterBy
- func (c *FilterBy) Chrome() *FilterBy
- func (c *FilterBy) Edge() *FilterBy
- func (c *FilterBy) Firefox() *FilterBy
- func (c *FilterBy) Get() string
- func (c *FilterBy) GetRaw() UserAgents
- func (c *FilterBy) Opera() *FilterBy
- func (c *FilterBy) Os(f ...string) *FilterBy
- func (c *FilterBy) OsVer(f int) *FilterBy
- func (c *FilterBy) Platform(f ...string) *FilterBy
- func (c *FilterBy) Safari() *FilterBy
- type UserAgent
- type UserAgents
Constants ¶
View Source
const ( Google = "Google" Chrome = "Chrome" Firefox = "Firefox" Edge = "Edge" Opera = "Opera" Safari = "Safari" AndroidBrowser = "Android" YandexBrowser = "Yandex Browser" SamsungInternet = "Samsung Internet" OperaMobile = "Opera Mobile" MobileSafari = "Mobile Safari" FirefoxMobile = "Firefox Mobile" FirefoxiOS = "Firefox iOS" ChromeMobile = "Chrome Mobile" ChromeMobileiOS = "Chrome Mobile iOS" MobileSafariUIWK = "Mobile Safari UI/WKWebView" EdgeMobile = "Edge Mobile" DuckDuckGoMobile = "DuckDuckGo Mobile" MiuiBrowser = "MiuiBrowser" Whale = "Whale" Twitter = "Twitter" Facebook = "Facebook" AmazonSilk = "Amazon Silk" )
Browsers
View Source
const ( Windows = "Windows" Linux = "Linux" Ubuntu = "Ubuntu" ChromeOS = "Chrome OS" MacOSX = "Mac OS X" Android = "Android" IOS = "iOS" )
OS
View Source
const ( Mobile = "mobile" Tablet = "tablet" Desktop = "desktop" )
Platforms
Variables ¶
This section is empty.
Functions ¶
func ExtractMajorVersion ¶
Types ¶
type FilterBy ¶
type FilterBy struct {
UserAgent *UserAgent
// contains filtered or unexported fields
}
func (*FilterBy) Get ¶
Gets from filters Method return userAgent string only or empty string if nothing found
func (*FilterBy) GetRaw ¶
func (c *FilterBy) GetRaw() UserAgents
Gets from filters Method return all struct UserAgents or empty UserAgents struct if nothing found
type UserAgent ¶
type UserAgent struct {
List *[]UserAgents
Filtered []UserAgents
// contains filtered or unexported fields
}
func (*UserAgent) GetRandom ¶
Gets random user-Agent without filters This method don't init filter method
func (*UserAgent) SetFallback ¶
Set fallback user_agent
type UserAgents ¶
type UserAgents struct {
Useragent string `json:"useragent"`
Percent float64 `json:"percent"`
Type string `json:"type"`
DeviceBrand string `json:"device_brand"`
Browser string `json:"browser"`
BrowserVersion string `json:"browser_version"`
BrowserVersionMajorMinor float64 `json:"browser_version_major_minor"`
Os string `json:"os"`
OsVersion string `json:"os_version"`
Platform string `json:"platform"`
}
Click to show internal directories.
Click to hide internal directories.