useragent

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 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 composes the User-Agent header sent on Digital X API requests (both REST and the WebSocket upgrade). The string identifies the CLI and its version, the host environment (OS name, OS/kernel version, CPU architecture, and locale), and the call context — which frontend and sub-context issued the call, so server-side traffic can be attributed to "a CLI command", "a monitor bot's API call", "the streaming socket", and so on.

Format:

digitalx-cli/<version> (<os>[/<osver>]; <arch>[; <lang>]) ctx:<surface>[/<detail>]

e.g.

digitalx-cli/1.2.3 (darwin/25.6.0; arm64; ko_KR) ctx:cli/order.place
digitalx-cli/1.2.3 (linux/6.1.0; amd64; en_US) ctx:monitor/botapi
digitalx-cli/1.2.3 (windows/10.0.22631; amd64) ctx:doctor

It is applied ONLY to Digital X requests. This package deliberately lives ABOVE the wire layer (internal/apiclient): that package gathers no OS info and only carries the UserAgent seam, so callers compose the rich value here and inject it down. Nothing else (any future non-Digital X HTTP) should use this.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func For

func For(surface, detail string) string

For returns the full User-Agent for a Digital X call attributed to the given surface (the frontend identity, e.g. "cli", "monitor", "doctor") and optional finer detail (e.g. the command key, or "botapi"). Both map straight onto the apiclient.Origin{Surface,Detail} the caller already sets on the request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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