Documentation
¶
Index ¶
- Constants
- func GetDeviceCreater(name string) func(string) DeviceParser
- func RegDeviceParser(name string, f func(string) DeviceParser)
- type Camera
- type Car
- type Console
- type DeviceMatchResult
- type DeviceParser
- type DeviceParserAbstract
- type DeviceReg
- type HbbTv
- type Mobile
- type Model
- type PortableMediaPlayer
Constants ¶
View Source
const FixtureFileCamera = `cameras.yml`
View Source
const FixtureFileCar = `car_browsers.yml`
View Source
const FixtureFileConsole = `consoles.yml`
View Source
const FixtureFileHbbTv = `televisions.yml`
View Source
const FixtureFileMobile = `mobiles.yml`
View Source
const FixtureFilePortableMediaPlayer = `portable_media_player.yml`
View Source
const ParserNameCamera = `camera`
View Source
const ParserNameCar = `car browser`
View Source
const ParserNameConsole = `console`
View Source
const ParserNameHbbTv = `tv`
View Source
const ParserNameMobile = `mobile`
View Source
const ParserNamePortableMediaPlayer = `portablemediaplayer`
View Source
const UnknownBrand = "Unknown"
Variables ¶
This section is empty.
Functions ¶
func GetDeviceCreater ¶
func GetDeviceCreater(name string) func(string) DeviceParser
func RegDeviceParser ¶
func RegDeviceParser(name string, f func(string) DeviceParser)
Types ¶
type Camera ¶
type Camera struct {
DeviceParserAbstract
}
Device parser for camera detection
func (*Camera) Parse ¶
func (c *Camera) Parse(ua string) *DeviceMatchResult
type Car ¶
type Car struct {
DeviceParserAbstract
}
Device parser for car browser detection
func (*Car) Parse ¶
func (c *Car) Parse(ua string) *DeviceMatchResult
type Console ¶
type Console struct {
DeviceParserAbstract
}
Device parser for console detection
func NewConsole ¶
func (*Console) Parse ¶
func (c *Console) Parse(ua string) *DeviceMatchResult
type DeviceMatchResult ¶
type DeviceParser ¶
type DeviceParser interface { PreMatch(string) bool Parse(string) *DeviceMatchResult }
func NewDeviceParser ¶
func NewDeviceParser(dir, name string) DeviceParser
func NewDeviceParsers ¶
func NewDeviceParsers(dir string, names []string) []DeviceParser
type DeviceParserAbstract ¶
type DeviceParserAbstract struct { Regexes map[string]*DeviceReg // contains filtered or unexported fields }
func (*DeviceParserAbstract) Load ¶
func (d *DeviceParserAbstract) Load(file string) error
func (*DeviceParserAbstract) Parse ¶
func (d *DeviceParserAbstract) Parse(ua string) *DeviceMatchResult
func (*DeviceParserAbstract) PreMatch ¶
func (d *DeviceParserAbstract) PreMatch(ua string) bool
type HbbTv ¶
type HbbTv struct {
DeviceParserAbstract
}
Device parser for hbbtv detection
func (*HbbTv) Parse ¶
func (h *HbbTv) Parse(ua string) *DeviceMatchResult
type PortableMediaPlayer ¶
type PortableMediaPlayer struct {
DeviceParserAbstract
}
Device parser for portable media player detection
func NewPortableMediaPlayer ¶
func NewPortableMediaPlayer(fileName string) *PortableMediaPlayer
func (*PortableMediaPlayer) Parse ¶
func (p *PortableMediaPlayer) Parse(ua string) *DeviceMatchResult
Click to show internal directories.
Click to hide internal directories.