useragent

package
v1.14.11 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package useragent provides helper functions to pack version information into a single User-Agent header.

Index

Constants

This section is empty.

Variables

This section is empty.

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".

func Get

func Get(ctx context.Context) string

Get is the User-Agent the CRI-O daemon uses to identify itself.

Types

type VersionInfo

type VersionInfo struct {
	Name    string
	Version string
}

VersionInfo is used to model UserAgent versions.

Jump to

Keyboard shortcuts

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