Documentation ¶
Index ¶
- Constants
- func GetBrowserFamily(browserLabel string) (string, bool)
- func GetClientCreater(name string) func(string) ClientParser
- func IsMobileOnlyBrowser(browser string) bool
- func RegClientParser(name string, f func(string) ClientParser)
- type Browser
- type BrowserEngine
- type BrowserItem
- type BrowserMatchResult
- type ClientMatchResult
- type ClientParser
- type ClientParserAbstract
- type ClientReg
- type Engine
- type FeedReader
- type Library
- type MediaPlayer
- type MobileApp
- type Pim
- type Version
Constants ¶
View Source
const FixtureFileBrowser = `browsers.yml`
View Source
const FixtureFileBrowserEngine = `browser_engine.yml`
View Source
const FixtureFileFeedReader = `feed_readers.yml`
View Source
const FixtureFileLibrary = `libraries.yml`
View Source
const FixtureFileMediaPlayer = `mediaplayers.yml`
View Source
const FixtureFileMobileApp = `mobile_apps.yml`
View Source
const FixtureFilePim = `pim.yml`
View Source
const ParserNameBrowser = `browser`
View Source
const ParserNameBrowserEngine = `browserengine`
View Source
const ParserNameFeedReader = `feed reader`
View Source
const ParserNameLibrary = `library`
View Source
const ParserNameMediaPlayer = `mediaplayer`
View Source
const ParserNameMobileApp = `mobile app`
View Source
const ParserNamePim = `pim`
Variables ¶
This section is empty.
Functions ¶
func GetBrowserFamily ¶
func GetClientCreater ¶
func GetClientCreater(name string) func(string) ClientParser
func IsMobileOnlyBrowser ¶
Returns if the given browser is mobile only
func RegClientParser ¶
func RegClientParser(name string, f func(string) ClientParser)
Types ¶
type Browser ¶
type Browser struct { Regexes []*BrowserItem // contains filtered or unexported fields }
Client parser for browser detection
func NewBrowser ¶
func (*Browser) BuildEngine ¶
func (*Browser) BuildEngineVersion ¶
func (*Browser) Parse ¶
func (b *Browser) Parse(ua string) *BrowserMatchResult
type BrowserEngine ¶
type BrowserEngine struct {
ClientParserAbstract
}
func NewBrowserEngine ¶
func NewBrowserEngine(fileName string) *BrowserEngine
func (*BrowserEngine) Parse ¶
func (d *BrowserEngine) Parse(ua string) *ClientMatchResult
type BrowserItem ¶
type BrowserMatchResult ¶
type BrowserMatchResult = ClientMatchResult
type ClientMatchResult ¶
type ClientMatchResult struct { Type string `yaml:"type" json:"type"` Name string `yaml:"name" json:"name"` Version string `yaml:"version" json:"version"` ShortName string `yaml:"short_name" json:"short_name"` Engine string `yaml:"engine" json:"engine"` EngineVersion string `yaml:"engine_version" json:"engine_version"` }
type ClientParser ¶
type ClientParser interface { PreMatch(string) bool Parse(string) *ClientMatchResult }
func NewClientParser ¶
func NewClientParser(dir, name string) ClientParser
func NewClientParsers ¶
func NewClientParsers(dir string, names []string) []ClientParser
type ClientParserAbstract ¶
type ClientParserAbstract struct { Regexes []*ClientReg ParserName string // contains filtered or unexported fields }
Parses the current UA and checks whether it contains any client information
func (*ClientParserAbstract) GetAvailableClients ¶
func (c *ClientParserAbstract) GetAvailableClients() []string
Returns all names defined in the regexes Attention: This method might not return all names of detected clients
func (*ClientParserAbstract) Load ¶
func (c *ClientParserAbstract) Load(file string) error
func (*ClientParserAbstract) Parse ¶
func (c *ClientParserAbstract) Parse(ua string) *ClientMatchResult
Parses the current UA and checks whether it contains any client information
func (*ClientParserAbstract) PreMatch ¶
func (c *ClientParserAbstract) PreMatch(ua string) bool
type FeedReader ¶
type FeedReader struct {
ClientParserAbstract
}
Client parser for feed reader detection
func NewFeedReader ¶
func NewFeedReader(fileName string) *FeedReader
type Library ¶
type Library struct {
ClientParserAbstract
}
Client parser for tool & software detection
func NewLibrary ¶
type MediaPlayer ¶
type MediaPlayer struct {
ClientParserAbstract
}
Client parser for mediaplayer detection
func NewMediaPlayer ¶
func NewMediaPlayer(fileName string) *MediaPlayer
type MobileApp ¶
type MobileApp struct {
ClientParserAbstract
}
Client parser for mobile app detection
func NewMobileApp ¶
type Pim ¶
type Pim struct {
ClientParserAbstract
}
Client parser for pim (personal information manager) detection
Click to show internal directories.
Click to hide internal directories.