useragent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package useragent composes the User-Agent header sent on Korbit 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:

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

e.g.

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

It is applied ONLY to Korbit requests. This package deliberately lives ABOVE the wire layer (internal/korbit): 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-Korbit 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 Korbit 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 korbit.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