summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/utils/handler.go
diff options
context:
space:
mode:
authorzhangguanzhang <guanzhangzhang@gmail.com>2020-06-12 19:54:10 +0800
committerGitHub <noreply@github.com>2020-06-12 19:54:10 +0800
commit64eae15aa7905dd49f4a348f6b4765dfb4d9dd91 (patch)
tree2914c20a2e0e15383da50334cad89b9b85b209a1 /pkg/api/handlers/utils/handler.go
parent3218736cff4b718b8fe855759687cb66f19d6e1e (diff)
parent8aa5cf3d45998bc92eaafd67ab2a59e3722bade4 (diff)
downloadpodman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.tar.gz
podman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.tar.bz2
podman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.zip
Merge pull request #1 from containers/master
# sync
Diffstat (limited to 'pkg/api/handlers/utils/handler.go')
-rw-r--r--pkg/api/handlers/utils/handler.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkg/api/handlers/utils/handler.go b/pkg/api/handlers/utils/handler.go
index 2f4a54b98..62fdc05dd 100644
--- a/pkg/api/handlers/utils/handler.go
+++ b/pkg/api/handlers/utils/handler.go
@@ -28,27 +28,27 @@ const (
// CompatTree supports Libpod endpoints
CompatTree
- // CurrentApiVersion announces what is the current API level
- CurrentApiVersion = VersionLevel(iota)
- // MinimalApiVersion announces what is the oldest API level supported
- MinimalApiVersion
+ // CurrentAPIVersion announces what is the current API level
+ CurrentAPIVersion = VersionLevel(iota)
+ // MinimalAPIVersion announces what is the oldest API level supported
+ MinimalAPIVersion
)
var (
// See https://docs.docker.com/engine/api/v1.40/
// libpod compat handlers are expected to honor docker API versions
- // ApiVersion provides the current and minimal API versions for compat and libpod endpoint trees
+ // APIVersion provides the current and minimal API versions for compat and libpod endpoint trees
// Note: GET|HEAD /_ping is never versioned and provides the API-Version and Libpod-API-Version headers to allow
// clients to shop for the Version they wish to support
- ApiVersion = map[VersionTree]map[VersionLevel]semver.Version{
+ APIVersion = map[VersionTree]map[VersionLevel]semver.Version{
LibpodTree: {
- CurrentApiVersion: semver.MustParse("1.0.0"),
- MinimalApiVersion: semver.MustParse("1.0.0"),
+ CurrentAPIVersion: semver.MustParse("1.0.0"),
+ MinimalAPIVersion: semver.MustParse("1.0.0"),
},
CompatTree: {
- CurrentApiVersion: semver.MustParse("1.40.0"),
- MinimalApiVersion: semver.MustParse("1.24.0"),
+ CurrentAPIVersion: semver.MustParse("1.40.0"),
+ MinimalAPIVersion: semver.MustParse("1.24.0"),
},
}
@@ -103,8 +103,8 @@ func SupportedVersionWithDefaults(r *http.Request) (semver.Version, error) {
}
return SupportedVersion(r,
- fmt.Sprintf(">=%s <=%s", ApiVersion[tree][MinimalApiVersion].String(),
- ApiVersion[tree][CurrentApiVersion].String()))
+ fmt.Sprintf(">=%s <=%s", APIVersion[tree][MinimalAPIVersion].String(),
+ APIVersion[tree][CurrentAPIVersion].String()))
}
// WriteResponse encodes the given value as JSON or string and renders it for http client