apiutil

package
v4.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVersionNotGiven returned when version not given by client
	ErrVersionNotGiven = errors.New("version not given in URL path")
	// ErrVersionNotSupported returned when given version is too old
	ErrVersionNotSupported = errors.New("given version is not supported")
)

Functions

func IsLibpodRequest

func IsLibpodRequest(r *http.Request) bool

IsLibpodRequest returns true if the request related to a libpod endpoint (e.g., /v2/libpod/...).

func SupportedVersion

func SupportedVersion(r *http.Request, condition string) (semver.Version, error)

SupportedVersion validates that the version provided by client is included in the given condition https://github.com/blang/semver#ranges provides the details for writing conditions If a version is not given in URL path, ErrVersionNotGiven is returned

func SupportedVersionWithDefaults

func SupportedVersionWithDefaults(r *http.Request) (semver.Version, error)

SupportedVersionWithDefaults validates that the version provided by client valid is supported by server minimal API version <= client path version <= maximum API version focused on the endpoint tree from URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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