sdhttpua

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sdhttpua HTTP UserAgent 工具

Index

Constants

This section is empty.

Variables

View Source
var All = make([]*UA, 0)
View Source
var (
	ErrParse = sderr.Sentinel("sdhttpua parse User-Agent error")
)

Functions

func FindRaw

func FindRaw(predicates ...Predicate) []string

Types

type Predicate

type Predicate func(*UA) bool

func IsMobile

func IsMobile() Predicate

func OSIs

func OSIs(os string, others ...string) Predicate

func Or

func Or(first Predicate, others ...Predicate) Predicate

func PlatformIs

func PlatformIs(platform string, others ...string) Predicate

func (Predicate) Not

func (p Predicate) Not() Predicate

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 Find

func Find(predicates ...Predicate) []*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