gobrowscap

package module
v0.0.0-...-ee54161 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 11 Imported by: 0

README

Example:

package main

import "fmt"
import "gobrowscap"

func main() {

    iniFile, err := gobrowscap.LoadIniFile("/tmp/full_php_browscap.ini", 10)
    if err != nil { 
        return
    }   
    
    fmt.Println(gobrowscap.GetFileVersion(iniFile))
    
    browser, err := gobrowscap.SearchBrowser(iniFile, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")
    fmt.Println(browser)
} 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileVersion

func GetFileVersion(iniFile *IniFile) string

Types

type Batch

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

type Browser

type Browser struct {
	Pattern              string
	Parent               string
	Comment              string
	Browser              string
	BrowserType          string
	BrowserMaker         string
	Platform             string
	PlatformVersion      string
	IsMobileDevice       bool
	HasIsMobileDevice    bool
	IsTablet             bool
	HasIsTablet          bool
	IsCrawler            bool
	HasIsCrawler         bool
	Version              string
	MajorVersion         string
	MinorVersion         string
	DeviceType           string
	DevicePointingMethod string
	DeviceName           string
	DeviceCodeName       string
	DeviceBrandName      string
}

func SearchBrowser

func SearchBrowser(iniFile *IniFile, userAgent string) (*Browser, error)

type DeduplicatedPattern

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

type IniFile

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

func LoadIniFile

func LoadIniFile(path string, batchSize int) (*IniFile, error)

type IniSection

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

type Pattern

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

type TmpPattern

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

Jump to

Keyboard shortcuts

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