parser

package
v0.0.0-...-d5397ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrawlerClassId   = 99
	CrawlerClass     = "Crawler"
	CrawlerCode      = "crawler"
	BotDetailUrl     = "https://udger.com/resources/ua-list/bot-detail?bot="
	OsDetailUrl      = "https://udger.com/resources/ua-list/os-detail?os="
	BrowserDetailUrl = "https://udger.com/resources/ua-list/browser-detail?browser="
	DeviceDetailUrl  = "https://udger.com/resources/ua-list/device-detail?device="
	IpV4             = "v4"
	IpV6             = "v6"

	BrowsersSqlQuery = `` /* 558-byte string literal not displayed */

	OsSqlQuery = `` /* 305-byte string literal not displayed */

	OsRelationSqlQuery = `` /* 303-byte string literal not displayed */

	DevicesSqlQuery = `` /* 260-byte string literal not displayed */

	DeviceClassListSqlQuery = `` /* 212-byte string literal not displayed */

	DeviceCodeListSqlQuery = `SELECT
	   id,
       os_family_code,
	   os_code,
	   regstring
	  FROM
	   udger_devicename_regex`

	BrandByRegexIdAndCodeSqlQuery = `` /* 235-byte string literal not displayed */

	IpSqlQuery = `` /* 832-byte string literal not displayed */

	CrawlersSqlQuery = `` /* 417-byte string literal not displayed */

	CrawlersByUaSqlQuery = `` /* 448-byte string literal not displayed */

	GetDataCenterV4SqlQuery = `` /* 216-byte string literal not displayed */

	GetDataCenterV6SqlQuery = `` /* 584-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func ToNullString

func ToNullString(s string) sql.NullString

Types

type Browser

type Browser struct {
	ClassId                  int64
	Id                       int64
	BrowserInfo              Info
	VendorInfo               Info
	Engine                   string
	UptodateCurrentVersion   string
	ClientClassification     string
	ClientClassificationCode string
}

type Crawler

type Crawler struct {
	Id                        sql.NullInt64
	Name                      sql.NullString
	Version                   sql.NullString
	VersionMajor              sql.NullString
	FamilyInfo                Info
	FamilyVendorInfo          Info
	LastSeen                  sql.NullString
	CrawlerClassification     sql.NullString
	CrawlerClassificationCode sql.NullString
	RespectRobotstxt          sql.NullString
	UaString                  string
}

type Device

type Device struct {
	Id   int64
	Info Info
}

type DeviceCode

type DeviceCode struct {
	Id            int64
	OsFamilyCode  string
	OsCode        string
	RegexCompiled pcre.Regexp
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type Info

type Info struct {
	Name     sql.NullString
	Code     sql.NullString
	Icon     sql.NullString
	IconBig  sql.NullString
	Url      sql.NullString
	Homepage sql.NullString
}

type IpAddress

type IpAddress struct {
	Ip                 sql.NullString
	Version            sql.NullString
	Classification     sql.NullString
	ClassificationCode sql.NullString
	Hostname           sql.NullString
	LastSeen           sql.NullString
	Country            sql.NullString
	CountryCode        sql.NullString
	City               sql.NullString
	DataCenterInfo     Info
	Crawler            Crawler
}

type Os

type Os struct {
	Id         int64
	Info       Info
	FamilyInfo Info
	VendorInfo Info
}

type UdgerFastLoadSlowExec

type UdgerFastLoadSlowExec struct {
	// contains filtered or unexported fields
}

func NewFS

func NewFS(dbPath string) (*UdgerFastLoadSlowExec, error)

func (*UdgerFastLoadSlowExec) ParseIp

func (udger *UdgerFastLoadSlowExec) ParseIp(ip string) (ipAddress IpAddress)

func (*UdgerFastLoadSlowExec) ParseUa

func (udger *UdgerFastLoadSlowExec) ParseUa(userAgentString string) (userAgent UserAgent, err error)

type UdgerSlowLoadFastExec

type UdgerSlowLoadFastExec struct {
	UserAgent UserAgent
	IpAddress IpAddress

	BrowserList     map[int64]Browser
	OsList          map[int64]Os
	DeviceList      map[string]Device
	DeviceClassList map[int64]Device
	DeviceCodeList  map[int64]DeviceCode
	IpList          map[string]IpAddress
	CrawlerList     map[string]Crawler

	DbPath string
	// contains filtered or unexported fields
}

func NewSF

func NewSF(dbPath string) (*UdgerSlowLoadFastExec, error)

func (*UdgerSlowLoadFastExec) ParseIp

func (udger *UdgerSlowLoadFastExec) ParseIp(ip string) (ipAddress IpAddress)

func (*UdgerSlowLoadFastExec) ParseUa

func (udger *UdgerSlowLoadFastExec) ParseUa(userAgentString string) (userAgent UserAgent, err error)

type UserAgent

type UserAgent struct {
	String                 string
	Name                   string
	Class                  string
	ClassCode              string
	Version                string
	VersionMajor           string
	UpToDateCurrentVersion string
	FamilyInfo             Info
	FamilyVendorInfo       Info
	Engine                 string
	OsInfo                 Info
	OsFamilyInfo           Info
	OsFamilyVendorInfo     Info
	DeviceInfo             Info
	DeviceMarketName       string
	DeviceBrandInfo        Info
	Crawler                Crawler
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL