Documentation
¶
Overview ¶
This file is auto-generated! Any changes to this file will be lost!
Index ¶
- Constants
- Variables
- type DataSet
- type Parser
- func (p *Parser) ChallengeAppliance(agent string, result *Result) error
- func (p *Parser) ChallengeAu(agent string, result *Result) error
- func (p *Parser) ChallengeCrawlers(agent string, result *Result) error
- func (p *Parser) ChallengeDesktopTools(agent string, result *Result) error
- func (p *Parser) ChallengeDigitalTv(agent string, result *Result) error
- func (p *Parser) ChallengeDocomo(agent string, result *Result) error
- func (p *Parser) ChallengeFirefox(agent string, result *Result) error
- func (p *Parser) ChallengeFirefoxiOS(agent string, result *Result) error
- func (p *Parser) ChallengeGoogle(agent string, result *Result) error
- func (p *Parser) ChallengeHTTPLibrary(agent string, result *Result) error
- func (p *Parser) ChallengeLinux(agent string, result *Result) error
- func (p *Parser) ChallengeMaybeCrawler(agent string, result *Result) error
- func (p *Parser) ChallengeMaybeRssReader(agent string, result *Result) error
- func (p *Parser) ChallengeMiscMobilephone(agent string, result *Result) error
- func (p *Parser) ChallengeMiscOs(agent string, result *Result) error
- func (p *Parser) ChallengeMobilephone(agent string, result *Result) error
- func (p *Parser) ChallengeMsEdge(agent string, result *Result) error
- func (p *Parser) ChallengeMsie(agent string, result *Result) error
- func (p *Parser) ChallengeNintendo(agent string, result *Result) error
- func (p *Parser) ChallengeOpera(agent string, result *Result) error
- func (p *Parser) ChallengeOsx(agent string, result *Result) error
- func (p *Parser) ChallengePlaystation(agent string, result *Result) error
- func (p *Parser) ChallengeSafariChrome(agent string, result *Result) error
- func (p *Parser) ChallengeSleipnir(agent string, result *Result) error
- func (p *Parser) ChallengeSmartphone(agent string, result *Result) error
- func (p *Parser) ChallengeSmartphonePatterns(agent string, result *Result) error
- func (p *Parser) ChallengeSoftbank(agent string, result *Result) error
- func (p *Parser) ChallengeVivaldi(agent string, result *Result) error
- func (p *Parser) ChallengeWebview(agent string, result *Result) error
- func (p *Parser) ChallengeWillcom(agent string, result *Result) error
- func (p *Parser) ChallengeWindows(agent string, result *Result) error
- func (p *Parser) ChallengeYandexBrowser(agent string, result *Result) error
- func (p *Parser) LookupDataSet(label string) (*Result, error)
- func (p *Parser) Parse(agent string) (result *Result, err error)
- func (p *Parser) PopulateDataSet(result *Result, label string) error
- func (p *Parser) TryAppliance(agent string, result *Result) (err error)
- func (p *Parser) TryBrowser(agent string, result *Result) (err error)
- func (p *Parser) TryCrawler(agent string, result *Result) (err error)
- func (p *Parser) TryMisc(agent string, result *Result) (err error)
- func (p *Parser) TryMobilephone(agent string, result *Result) (err error)
- func (p *Parser) TryOs(agent string, result *Result) (err error)
- func (p *Parser) TryRareCases(agent string, result *Result) (err error)
- type Result
Constants ¶
View Source
const ( ValueUnknown = "UNKNOWN" CategoryPC = "pc" CategorySmartphone = "smartphone" CategoryMobilephone = "mobilephone" CategoryAppliance = "appliance" CategoryCrawler = "crawler" CategoryMisc = "misc" )
Variables ¶
View Source
var ( EmptyResult = &Result{ Name: ValueUnknown, Category: ValueUnknown, Os: ValueUnknown, OsVersion: ValueUnknown, Type: ValueUnknown, Version: ValueUnknown, Vendor: ValueUnknown, } ErrNoMatch = errors.New("no match") ErrNoDataSet = errors.New("no such dataset") DefaultParser = NewParser() )
View Source
var CrawlerPrefixPatterns = []string{
"Rome Client ",
"UnwindFetchor/",
"ia_archiver ",
"Summify ",
"PostRank/",
}
View Source
var PHPPrefixPatterns = []string{
"PHP",
"WordPress",
"CakePHP",
"PukiWiki",
"PECL::HTTP",
}
View Source
var PearPatterns = []string{
"PEAR HTTP_Request",
"HTTP_Request",
}
Functions ¶
This section is empty.
Types ¶
type DataSet ¶
var DefaultDataSet DataSet = DataSet{ "MSIE": &Result{ Name: "Internet Explorer", Type: "", Vendor: "Microsoft", }, "Edge": &Result{ Name: "Edge", Type: "", Vendor: "Microsoft", }, "Chrome": &Result{ Name: "Chrome", Type: "", Vendor: "Google", }, "Safari": &Result{ Name: "Safari", Type: "", Vendor: "Apple", }, "Firefox": &Result{ Name: "Firefox", Type: "", Vendor: "Mozilla", }, "Opera": &Result{ Name: "Opera", Type: "", Vendor: "Opera", }, "Vivaldi": &Result{ Name: "Vivaldi", Type: "", Vendor: "Vivaldi Technologies", }, "Sleipnir": &Result{ Name: "Sleipnir", Type: "", Vendor: "Fenrir Inc.", }, "Webview": &Result{ Name: "Webview", Type: "", Vendor: "OS vendor", }, "YaBrowser": &Result{ Name: "Yandex Browser", Type: "", Vendor: "Yandex", }, "Win": &Result{ Name: "Windows UNKNOWN Ver", Type: "pc", Category: "pc", }, "Win10": &Result{ Name: "Windows 10", Type: "pc", Category: "pc", }, "Win8.1": &Result{ Name: "Windows 8.1", Type: "pc", Category: "pc", }, "Win8": &Result{ Name: "Windows 8", Type: "pc", Category: "pc", }, "Win7": &Result{ Name: "Windows 7", Type: "pc", Category: "pc", }, "WinVista": &Result{ Name: "Windows Vista", Type: "pc", Category: "pc", }, "WinXP": &Result{ Name: "Windows XP", Type: "pc", Category: "pc", }, "Win2000": &Result{ Name: "Windows 2000", Type: "pc", Category: "pc", }, "WinNT4": &Result{ Name: "Windows NT 4.0", Type: "pc", Category: "pc", }, "WinMe": &Result{ Name: "Windows Me", Type: "pc", Category: "pc", }, "Win98": &Result{ Name: "Windows 98", Type: "pc", Category: "pc", }, "Win95": &Result{ Name: "Windows 95", Type: "pc", Category: "pc", }, "WinPhone": &Result{ Name: "Windows Phone OS", Type: "smartphone", Category: "smartphone", }, "WinCE": &Result{ Name: "Windows CE", Type: "smartphone", Category: "smartphone", }, "OSX": &Result{ Name: "Mac OSX", Type: "pc", Category: "pc", }, "MacOS": &Result{ Name: "Mac OS Classic", Type: "pc", Category: "pc", }, "Linux": &Result{ Name: "Linux", Type: "pc", Category: "pc", }, "BSD": &Result{ Name: "BSD", Type: "pc", Category: "pc", }, "ChromeOS": &Result{ Name: "ChromeOS", Type: "pc", Category: "pc", }, "Android": &Result{ Name: "Android", Type: "smartphone", Category: "smartphone", }, "iPhone": &Result{ Name: "iPhone", Type: "smartphone", Category: "smartphone", }, "iPad": &Result{ Name: "iPad", Type: "smartphone", Category: "smartphone", }, "iPod": &Result{ Name: "iPod", Type: "smartphone", Category: "smartphone", }, "iOS": &Result{ Name: "iOS", Type: "smartphone", Category: "smartphone", }, "FirefoxOS": &Result{ Name: "Firefox OS", Type: "smartphone", Category: "smartphone", }, "BlackBerry": &Result{ Name: "BlackBerry", Type: "smartphone", Category: "smartphone", }, "BlackBerry10": &Result{ Name: "BlackBerry 10", Type: "smartphone", Category: "smartphone", }, "docomo": &Result{ Name: "docomo", Type: "mobilephone", Vendor: "docomo", Category: "mobilephone", Os: "docomo", }, "au": &Result{ Name: "au by KDDI", Type: "mobilephone", Vendor: "au", Category: "mobilephone", Os: "au", }, "SoftBank": &Result{ Name: "SoftBank Mobile", Type: "mobilephone", Vendor: "SoftBank", Category: "mobilephone", Os: "SoftBank", }, "willcom": &Result{ Name: "WILLCOM", Type: "mobilephone", Vendor: "WILLCOM", Category: "mobilephone", Os: "WILLCOM", }, "jig": &Result{ Name: "jig browser", Type: "mobilephone", Vendor: "", Category: "mobilephone", Os: "jig", }, "emobile": &Result{ Name: "emobile", Type: "mobilephone", Vendor: "", Category: "mobilephone", Os: "emobile", }, "SymbianOS": &Result{ Name: "SymbianOS", Type: "mobilephone", Vendor: "", Category: "mobilephone", Os: "SymbianOS", }, "MobileTranscoder": &Result{ Name: "Mobile Transcoder", Type: "mobilephone", Vendor: "", Category: "mobilephone", Os: "Mobile Transcoder", }, "Nintendo3DS": &Result{ Name: "Nintendo 3DS", Type: "appliance", Vendor: "Nintendo", Category: "appliance", Os: "Nintendo 3DS", }, "NintendoDSi": &Result{ Name: "Nintendo DSi", Type: "appliance", Vendor: "Nintendo", Category: "appliance", Os: "Nintendo DSi", }, "NintendoWii": &Result{ Name: "Nintendo Wii", Type: "appliance", Vendor: "Nintendo", Category: "appliance", Os: "Nintendo Wii", }, "NintendoWiiU": &Result{ Name: "Nintendo Wii U", Type: "appliance", Vendor: "Nintendo", Category: "appliance", Os: "Nintendo Wii U", }, "PSP": &Result{ Name: "PlayStation Portable", Type: "appliance", Vendor: "Sony", Category: "appliance", Os: "PlayStation Portable", }, "PSVita": &Result{ Name: "PlayStation Vita", Type: "appliance", Vendor: "Sony", Category: "appliance", Os: "PlayStation Vita", }, "PS3": &Result{ Name: "PlayStation 3", Type: "appliance", Vendor: "Sony", Category: "appliance", Os: "PlayStation 3", }, "PS4": &Result{ Name: "PlayStation 4", Type: "appliance", Vendor: "Sony", Category: "appliance", Os: "PlayStation 4", }, "Xbox360": &Result{ Name: "Xbox 360", Type: "appliance", Vendor: "Microsoft", Category: "appliance", Os: "Xbox 360", }, "XboxOne": &Result{ Name: "Xbox One", Type: "appliance", Vendor: "Microsoft", Category: "appliance", Os: "Xbox One", }, "DigitalTV": &Result{ Name: "InternetTVBrowser", Type: "appliance", Vendor: "", Category: "appliance", Os: "DigitalTV", }, "SafariRSSReader": &Result{ Name: "Safari RSSReader", Type: "misc", Vendor: "Apple", Category: "misc", Os: "UNKNOWN", }, "GoogleDesktop": &Result{ Name: "Google Desktop", Type: "misc", Vendor: "Google", Category: "misc", Os: "UNKNOWN", }, "WindowsRSSReader": &Result{ Name: "Windows RSSReader", Type: "misc", Vendor: "Microsoft", Category: "misc", Os: "UNKNOWN", }, "VariousRSSReader": &Result{ Name: "RSSReader", Type: "misc", Vendor: "", Category: "misc", Os: "UNKNOWN", }, "HTTPLibrary": &Result{ Name: "HTTP Library", Type: "misc", Vendor: "", Category: "misc", Os: "UNKNOWN", }, "GoogleBot": &Result{ Name: "Googlebot", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "GoogleBotMobile": &Result{ Name: "Googlebot Mobile", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "GoogleMediaPartners": &Result{ Name: "Google Mediapartners", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "GoogleFeedFetcher": &Result{ Name: "Google Feedfetcher", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "GoogleAppEngine": &Result{ Name: "Google AppEngine", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "GoogleWebPreview": &Result{ Name: "Google Web Preview", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "YahooSlurp": &Result{ Name: "Yahoo! Slurp", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "YahooJP": &Result{ Name: "Yahoo! Japan", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "YahooPipes": &Result{ Name: "Yahoo! Pipes", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "Baiduspider": &Result{ Name: "Baiduspider", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "msnbot": &Result{ Name: "msnbot", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "bingbot": &Result{ Name: "bingbot", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "BingPreview": &Result{ Name: "BingPreview", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "Yeti": &Result{ Name: "Naver Yeti", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "FeedBurner": &Result{ Name: "Google FeedBurner", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "facebook": &Result{ Name: "facebook", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "twitter": &Result{ Name: "twitter", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "trendictionbot": &Result{ Name: "trendiction", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "mixi": &Result{ Name: "mixi", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "IndyLibrary": &Result{ Name: "Indy Library", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "ApplePubSub": &Result{ Name: "Apple iCloud", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "Genieo": &Result{ Name: "Genieo Web Filter", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "topsyButterfly": &Result{ Name: "topsy Butterfly", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "rogerbot": &Result{ Name: "SeoMoz rogerbot", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "AhrefsBot": &Result{ Name: "ahref AhrefsBot", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "radian6": &Result{ Name: "salesforce radian6", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "Hatena": &Result{ Name: "Hatena", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "goo": &Result{ Name: "goo", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "livedoorFeedFetcher": &Result{ Name: "livedoor FeedFetcher", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, "VariousCrawler": &Result{ Name: "misc crawler", Type: "crawler", Vendor: "", Category: "crawler", Os: "UNKNOWN", }, }
type Parser ¶
type Parser struct {
AgentDataSet DataSet
}
func (*Parser) ChallengeAppliance ¶
func (*Parser) ChallengeCrawlers ¶
func (*Parser) ChallengeDesktopTools ¶
func (*Parser) ChallengeDigitalTv ¶
func (*Parser) ChallengeDocomo ¶
func (*Parser) ChallengeFirefox ¶
func (*Parser) ChallengeFirefoxiOS ¶ added in v1.8.0
func (*Parser) ChallengeGoogle ¶
func (*Parser) ChallengeHTTPLibrary ¶
func (*Parser) ChallengeMaybeCrawler ¶
func (*Parser) ChallengeMaybeRssReader ¶
func (*Parser) ChallengeMiscMobilephone ¶
func (*Parser) ChallengeMiscOs ¶
func (*Parser) ChallengeMobilephone ¶
func (*Parser) ChallengeMsEdge ¶ added in v1.8.0
func (*Parser) ChallengeNintendo ¶
func (*Parser) ChallengePlaystation ¶
func (*Parser) ChallengeSafariChrome ¶
func (*Parser) ChallengeSleipnir ¶
func (*Parser) ChallengeSmartphone ¶
func (*Parser) ChallengeSmartphonePatterns ¶
func (*Parser) ChallengeSoftbank ¶
func (*Parser) ChallengeVivaldi ¶ added in v1.8.0
func (*Parser) ChallengeWebview ¶ added in v1.8.0
func (*Parser) ChallengeWillcom ¶
func (*Parser) ChallengeWindows ¶
func (*Parser) ChallengeYandexBrowser ¶ added in v1.8.0
func (*Parser) PopulateDataSet ¶
func (*Parser) TryAppliance ¶
func (*Parser) TryMobilephone ¶
type Result ¶
type Result struct { Name string `json:"name"` Category string `json:"category"` Os string `json:"os"` OsVersion string `json:"os_version"` Type string `json:"type"` Version string `json:"version"` Vendor string `json:"vendor"` }
Click to show internal directories.
Click to hide internal directories.