useragent

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomUserAgent

func RandomUserAgent(r *rand.Rand) string

RandomUserAgent returns a random user agent string weighted by real-world prevalence. More common browsers are selected more frequently based on their market share.

func TotalWeight

func TotalWeight() int

TotalWeight returns the sum of all user agent weights

Types

type UserAgent

type UserAgent struct {
	String string
	Weight int
}

UserAgent represents a user agent string with its relative weight/frequency Weight represents the real-world prevalence of this user agent

func UserAgents

func UserAgents() []UserAgent

UserAgents returns a slice of all available user agents for reference/testing

Jump to

Keyboard shortcuts

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