Documentation
¶
Overview ¶
Package useragent centralizes the HTTP identity headers that built-in tools (api, fetch, openapi, ...) attach to every outbound request.
Index ¶
Constants ¶
View Source
const ( HeaderAgentVersion = "X-Docker-Agent-Version" HeaderDesktopVersion = "X-Docker-Desktop-Version" )
HTTP header names emitted by SetIdentity in addition to User-Agent.
Variables ¶
View Source
var Header = fmt.Sprintf("Cagent/%s (%s; %s)", version.Version, runtime.GOOS, runtime.GOARCH)
Header is the User-Agent value sent by built-in HTTP tools. It also doubles as the agent name fed to robotstxt.RobotsData.TestAgent so site operators see the same identity in both places.
Functions ¶
func SetIdentity ¶ added in v1.60.0
SetIdentity stamps the request with User-Agent, X-Docker-Agent-Version, and (when Docker Desktop is reachable) X-Docker-Desktop-Version. Callers that want operator-supplied overrides should apply those headers AFTER calling SetIdentity.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.