Apache Mesos
spec.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __MESOS_OCI_SPEC_HPP__
18 #define __MESOS_OCI_SPEC_HPP__
19 
20 #include <mesos/oci/spec.pb.h>
21 
22 namespace oci {
23 namespace spec {
24 namespace image {
25 namespace v1 {
26 
27 // Constant strings for OCI image media types:
28 // https://github.com/opencontainers/image-spec/blob/master/media-types.md
29 constexpr char MEDIA_TYPE_INDEX[] =
30  "application/vnd.oci.image.index.v1+json";
31 
32 constexpr char MEDIA_TYPE_MANIFEST[] =
33  "application/vnd.oci.image.manifest.v1+json";
34 
35 constexpr char MEDIA_TYPE_CONFIG[] =
36  "application/vnd.oci.image.config.v1+json";
37 
38 constexpr char MEDIA_TYPE_LAYER[] =
39  "application/vnd.oci.image.layer.v1.tar";
40 
41 constexpr char MEDIA_TYPE_LAYER_GZIP[] =
42  "application/vnd.oci.image.layer.v1.tar+gzip";
43 
44 constexpr char MEDIA_TYPE_NONDIST_LAYER[] =
45  "application/vnd.oci.image.layer.nondistributable.v1.tar";
46 
48  "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip";
49 
50 // Rootfs type of OCI image configuration.
51 constexpr char ROOTFS_TYPE[] = "layers";
52 
57 template <typename T>
58 Try<T> parse(const std::string& s);
59 
60 } // namespace v1 {
61 } // namespace image {
62 } // namespace spec {
63 } // namespace oci {
64 
65 #endif // __MESOS_OCI_SPEC_HPP__
constexpr char MEDIA_TYPE_MANIFEST[]
Definition: spec.hpp:32
Definition: check.hpp:33
constexpr char MEDIA_TYPE_INDEX[]
Definition: spec.hpp:29
constexpr char ROOTFS_TYPE[]
Definition: spec.hpp:51
Definition: spec.hpp:22
constexpr char MEDIA_TYPE_LAYER_GZIP[]
Definition: spec.hpp:41
constexpr char MEDIA_TYPE_CONFIG[]
Definition: spec.hpp:35
URI image(const std::string &repository, const std::string &reference, const std::string &registry, const Option< std::string > &scheme=None(), const Option< int > &port=None())
Definition: docker.hpp:30
constexpr char MEDIA_TYPE_NONDIST_LAYER[]
Definition: spec.hpp:44
constexpr char MEDIA_TYPE_NONDIST_LAYER_GZIP[]
Definition: spec.hpp:47
Try< T > parse(const std::string &s)
Returns the OCI v1 descriptor, image index, image manifest and image configuration from the given str...
Definition: parse.hpp:36
constexpr char MEDIA_TYPE_LAYER[]
Definition: spec.hpp:38