meson.protobuf.mesos

Utility functions to convert to and from mesos protobuf types.

->map

(->map record-name data)

This takes a map (possibly empty), generates a record from it, converts that to a Mesos protobuf object with the appropriate default values, and then returns a nested Clojure map with all those values. At that point, the data would be ready for conversion to another format (such as JSON).

->pb

(->pb map-type this)

Documentation forthcoming

->round-trip-map

(->round-trip-map record-name data & {:keys [drop-keys]})

map->json

(map->json record-name data)

Given a type’s record name (as a keyword) and a map for the type’s data, return a nested JSON string containing the passed data and any default values provided by Mesos.