useragent

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

UserAgent解析与列表。

Index

Constants

This section is empty.

Variables

View Source
var (
	All = []*UA{}
)
View Source
var (
	ErrParse = errors.New("Parse UA error")
)

Functions

func Choice

func Choice(filters ...Filter) string

func Find

func Find(filters ...Filter) []string

Types

type Filter

type Filter func(ua *UA) bool

type UA

type UA struct {
	UA                   string
	Mozilla              string
	Platform             string
	OS                   string
	Loc                  string
	Bot                  bool
	Mobile               bool
	BrowserEngine        string
	BrowserEngineVersion string
	BrowserName          string
	BrowserVersion       string
}

func ChoiceUA

func ChoiceUA(filters ...Filter) *UA

func FindUA

func FindUA(filters ...Filter) []*UA

func Parse

func Parse(s string, to *UA) (*UA, error)

Jump to

Keyboard shortcuts

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