useragent

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package useragent identifies Core on every outbound HTTP request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header() http.Header

Header returns a header set holding only the User-Agent, for dialers that take headers rather than a request, such as WebSocket handshakes.

func Set

func Set(req *http.Request)

Set adds the User-Agent to req unless the caller already set one.

func SetPlatform

func SetPlatform(id string)

SetPlatform records the running platform's ID. It is only known once a platform is constructed, so requests made before this omit it.

func String

func String() string

String returns the User-Agent value, for example "Zaparoo-Core/2.18.0 (mister; linux/arm)".

func Transport

func Transport(base http.RoundTripper) http.RoundTripper

Transport wraps base so every request carries the User-Agent. A nil base uses http.DefaultTransport as it is at request time, so a later swap of the default transport (custom TLS roots) still applies.

Types

This section is empty.

Jump to

Keyboard shortcuts

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