You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/01/19 01:12:37 UTC

[6/9] mesos git commit: Added utility functions to create docker URI.

Added utility functions to create docker URI.

Review: https://reviews.apache.org/r/42275


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b589a3ac
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b589a3ac
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b589a3ac

Branch: refs/heads/master
Commit: b589a3ac67c740ac84c54f2db2cc83b6a043d5ca
Parents: f070799
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Jan 13 14:42:31 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Jan 18 16:09:14 2016 -0800

----------------------------------------------------------------------
 src/Makefile.am            |  1 +
 src/uri/schemes/docker.hpp | 66 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b589a3ac/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 69383b6..4fabe60 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -790,6 +790,7 @@ libmesos_no_3rdparty_la_SOURCES +=					\
   uri/fetchers/curl.hpp							\
   uri/fetchers/docker.hpp						\
   uri/fetchers/hadoop.hpp						\
+  uri/schemes/docker.hpp						\
   uri/schemes/file.hpp							\
   uri/schemes/hdfs.hpp							\
   uri/schemes/http.hpp							\

http://git-wip-us.apache.org/repos/asf/mesos/blob/b589a3ac/src/uri/schemes/docker.hpp
----------------------------------------------------------------------
diff --git a/src/uri/schemes/docker.hpp b/src/uri/schemes/docker.hpp
new file mode 100644
index 0000000..68dbf3f
--- /dev/null
+++ b/src/uri/schemes/docker.hpp
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __URI_SCHEMES_DOCKER_HPP__
+#define __URI_SCHEMES_DOCKER_HPP__
+
+#include <string>
+
+#include <mesos/uri/uri.hpp>
+
+#include "uri/utils.hpp"
+
+namespace mesos {
+namespace uri {
+namespace docker {
+
+inline URI image(
+    const std::string& repository,
+    const std::string& tag,
+    const std::string& registry,
+    const Option<std::string>& scheme = None(),
+    const Option<int>& port = None())
+{
+  return construct("docker", repository, registry, port, tag, scheme);
+}
+
+
+inline URI manifest(
+    const std::string& repository,
+    const std::string& tag,
+    const std::string& registry,
+    const Option<std::string>& scheme = None(),
+    const Option<int>& port = None())
+{
+  return construct("docker-manifest", repository, registry, port, tag, scheme);
+}
+
+
+inline URI blob(
+    const std::string& repository,
+    const std::string& digest,
+    const std::string& registry,
+    const Option<std::string>& scheme = None(),
+    const Option<int>& port = None())
+{
+  return construct("docker-blob", repository, registry, port, digest, scheme);
+}
+
+} // namespace docker {
+} // namespace uri {
+} // namespace mesos {
+
+#endif // __URI_SCHEMES_DOCKER_HPP__