useragent

package
v2.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

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