ch

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 3 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	// Response headers
	CriticalCH = "Critical-CH"
	AcceptCH   = "Accept-CH"
	Vary       = "Vary"

	// Request headers
	SecCHUA                 = "Sec-CH-UA"
	SecCHUAArch             = "Sec-CH-UA-Arch"
	SecCHUABitness          = "Sec-CH-UA-Bitness"
	SecCHUAMobile           = "Sec-CH-UA-Mobile"
	SecCHUAModel            = "Sec-CH-UA-Model"
	SecCHUAPlatform         = "Sec-CH-UA-Platform"
	SecCHUAPlatformVersion  = "Sec-CH-UA-Platform-Version"
	SecCHPrefersColorScheme = "Sec-CH-Prefers-Color-Scheme"
)

Variables

This section is empty.

Functions

func GetArch

func GetArch(headers http.Header) string

GetArch provides the user-agent's underlying CPU architecture, such as ARM or x86.

func GetBitness

func GetBitness(headers http.Header) string

GetBitness provides the "bitness" of the user-agent's underlying CPU architecture. This is the size in bits of an integer or memory address—typically 64 or 32 bits.

func GetColorScheme

func GetColorScheme(headers http.Header) string

GetColorScheme provides user color scheme preference at request time A string indicating the user agent's preference for dark or light content: "light" or "dark".

func GetModel

func GetModel(headers http.Header) string

GetModel provides the device model on which the browser is running. For example "Pixel 3".

func GetPlatform

func GetPlatform(headers http.Header) string

GetPlatform provides the platform or operating system on which the user agent is running. One of the following strings: "Android", "Chrome OS", "Chromium OS", "iOS", "Linux", "macOS", "Windows", or "Unknown"

func GetPlatformVersion

func GetPlatformVersion(headers http.Header) string

GetPlatformVersion provides the version of the operating system on which the user agent is running. The version string typically contains the operating system version in a string, consisting of dot-separated major, minor and patch version numbers. For example, "11.0.0" The version string on Linux is always empty.

func IsMobile

func IsMobile(headers http.Header) bool

IsMobile indicates whether the browser is on a mobile device.

Types

type Brand

type Brand struct {
	Name    string
	Version string
}

func GetBrand

func GetBrand(headers http.Header) *Brand

GetBrand provides the user-agent's branding and significant version information.

Jump to

Keyboard shortcuts

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