Files
podman/pkg/bindings/bindings.go
Jhon Honce f9c392f50a V2 API Version Support
* Update blang/semver to allow ParseTolerant() support
* Provide helper functions for API handlers to obtain client's 'version'
  path variable focused on API endpoint tree: libpod vs. compat
* Introduce new errors:
  * version not given in path, endpoints may determine if this is a hard
    error (ErrVersionNotGiven)
  * given version not supported (ErrVersionNotSupported), only a soft
    error if the handler is going to hijack the connection
* Added unit tests for version parsing
* bindings check version on connect:
  * client <= Server API version connection is continued
  * client >= Server API version connection fails

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-20 10:21:30 -07:00

28 lines
871 B
Go

// Package bindings provides golang-based access
// to the Podman REST API. Users can then interact with API endpoints
// to manage containers, images, pods, etc.
//
// This package exposes a series of methods that allow users to firstly
// create their connection with the API endpoints. Once the connection
// is established, users can then manage the Podman container runtime.
package bindings
import (
"github.com/blang/semver"
)
var (
// PTrue is a convenience variable that can be used in bindings where
// a pointer to a bool (optional parameter) is required.
pTrue = true
PTrue = &pTrue
// PFalse is a convenience variable that can be used in bindings where
// a pointer to a bool (optional parameter) is required.
pFalse = false
PFalse = &pFalse
// _*YES*- podman will fail to run if this value is wrong
APIVersion = semver.MustParse("1.0.0")
)