package useragent
import "github.com/docker/cli/components/engine/pkg/useragent"
Package useragent provides helper functions to pack version information into a single User-Agent header.
Index ¶
Functions ¶
func AppendVersions ¶
func AppendVersions(base string, versions ...VersionInfo) string
AppendVersions converts versions to a string and appends the string to the string base.
Each VersionInfo will be converted to a string in the format of "product/version", where the "product" is get from the name field, while version is get from the version field. Several pieces of version information will be concatenated and separated by space.
Example: AppendVersions("base", VersionInfo{"foo", "1.0"}, VersionInfo{"bar", "2.0"}) results in "base foo/1.0 bar/2.0".
Types ¶
type VersionInfo ¶
VersionInfo is used to model UserAgent versions.
Source Files ¶
- Version
- v17.11.0-ce+incompatible
- Published
- Nov 20, 2017
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- 4 hours ago –
Tools for package owners.