Documentation
¶
Overview ¶
Package useragent names the CLI to the APIs it calls, so server-side analytics can tell its traffic apart from the console's and from other Go clients, which all send Go's default Go-http-client/1.1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func String ¶
String is the User-Agent for a build of the given version, such as "pgedge-cli/0.5.0 (darwin; arm64)".
func Wrap ¶
func Wrap(base http.RoundTripper, ua string) http.RoundTripper
Wrap returns base wrapped so every request carries ua. An empty ua returns base itself, as a test Runtime has none.
Types ¶
type Transport ¶
type Transport struct {
Base http.RoundTripper
UserAgent string
}
Transport sets the User-Agent header. Use Wrap.