MCPcopy Create free account
hub / github.com/apache/mesos / parse

Function parse

src/oci/spec.cpp:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123template <>
124Try<Descriptor> parse(const string& s)
125{
126 Try<JSON::Object> json = JSON::parse<JSON::Object>(s);
127 if (json.isError()) {
128 return Error("JSON parse failed: " + json.error());
129 }
130
131 Try<Descriptor> descriptor = protobuf::parse<Descriptor>(json.get());
132 if (descriptor.isError()) {
133 return Error("Protobuf parse failed: " + descriptor.error());
134 }
135
136 Option<Error> error = internal::validateDigest(descriptor->digest());
137 if (error.isSome()) {
138 return Error(
139 "OCI v1 image descriptor validation failed: " + error->message);
140 }
141
142 return descriptor.get();
143}
144
145
146template <>

Callers 15

__fetchMethod · 0.50
urlFetchBlobMethod · 0.50
apiMethod · 0.50
pollMethod · 0.50
FlagsMethod · 0.50
synchronizedFunction · 0.50
MesosProcessMethod · 0.50
createSlaveInfoMethod · 0.50
TEST_PFunction · 0.50
TEST_FFunction · 0.50

Calls 8

validateDigestFunction · 0.85
validateFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
isSomeMethod · 0.45
isNoneMethod · 0.45

Tested by

no test coverage detected