fog-pack 0.2.1

Binary Data format supporting immutable references, schema, and compression
Documentation
{
  "name": "fog-pack Core Schema",
  "version": 1,
  "doc": {
    "Map": {
      "req": {
        "doc": { "Ref": "Validator" }
      },
      "opt": {
        "name": { "Str": {} },
        "doc_compress": { "Ref": "Compress" },
        "description": { "Str": {} },
        "version": { "Int": {} },
        "entries": {
          "Map": {
            "values": {
              "Map": {
                "req": { "entry": { "Ref": "Validator" } },
                "opt": { "compress": { "Ref": "Compress" } }
              }
            }
          }
        },
        "types": {
          "Map": {
            "values": { "Ref": "Validator" }
          }
        },
        "max_regex": { "Int": { "min": 0, "max": 255 } }
      }
    }
  },
  "types": {
    "Compress": {
      "Enum": {
        "None": null,
        "General": {
          "Map": {
            "algorithm": { "Int": { "min": 0 } },
            "level": { "Int": { "min": 0, "max": 255 } }
          }
        },
        "Dict": {
          "Map": {
            "algorithm": { "Int": { "min": 0 } },
            "level": { "Int": { "min": 0, "max": 255 } },
            "dict": { "Bin": {} }
          }
        }
      }
    },
    "Validator": {
      "Enum": {
        "Null": null,
        "Bool": {
          "Map": {
            "comment": "The Boolean type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Bool": {} },
              "in": { "Array": { "items": { "Bool": {} } } },
              "nin": { "Array": { "items": { "Bool": {} } } },
              "query": { "Bool": {} }
            }
          }
        },
        "Int": {
          "Map": {
            "comment": "The Integer type validator",
            "opt": {
              "comment": { "Str": {} },
              "bits_clr": { "Int": { "min": 0 } },
              "bits_set": { "Int": { "min": 0 } },
              "default": { "Int": {} },
              "max": { "Int": {} },
              "min": { "Int": {} },
              "ex_max": { "Bool": {} },
              "ex_min": { "Bool": {} },
              "in": { "Array": { "items": { "Int": {} } } },
              "nin": { "Array": { "items": { "Int": {} } } },
              "query": { "Bool": {} },
              "bit": { "Bool": {} },
              "ord": { "Bool": {} }
            }
          }
        },
        "Str": {
          "Map": {
            "comment": "The String type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Str": {} },
              "in": { "Array": { "items": { "Str": {} } } },
              "nin": { "Array": { "items": { "Str": {} } } },
              "matches": { "Str": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "min_len": { "Int": { "min": 0, "max": 4294967295 } },
              "max_char": { "Int": { "min": 0 } },
              "min_char": { "Int": { "min": 0 } },
              "normalize": {
                "Enum": {
                  "None": null,
                  "NFC": null,
                  "NFKC": null
                }
              },
              "query": { "Bool": {} },
              "regex": { "Bool": {} },
              "size": { "Bool": {} }
            }
          }
        },
        "F32": {
          "Map": {
            "comment": "The F32 type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "F32": {} },
              "max": { "F32": { } },
              "min": { "F32": { } },
              "ex_max": { "Bool": {} },
              "ex_min": { "Bool": {} },
              "in": { "Array": { "items": { "F32": {} } } },
              "nin": { "Array": { "items": { "F32": {} } } },
              "query": { "Bool": {} },
              "ord": { "Bool": {} }
            }
          }
        },
        "F64": {
          "Map": {
            "comment": "The F64 type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "F64": {} },
              "max": { "F64": { } },
              "min": { "F64": { } },
              "ex_max": { "Bool": {} },
              "ex_min": { "Bool": {} },
              "in": { "Array": { "items": { "F64": {} } } },
              "nin": { "Array": { "items": { "F64": {} } } },
              "query": { "Bool": {} },
              "ord": { "Bool": {} }
            }
          }
        },
        "Bin": {
          "Map": {
            "comment": "The Binary type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Bin": {} },
              "bits_clr": { "type": "Bin" },
              "bits_set": { "type": "Bin" },
              "ex_max": { "Bool": {} },
              "ex_min": { "Bool": {} },
              "max": { "Bin": {} },
              "min": { "Bin": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "min_len": { "Int": { "min": 0, "max": 4294967295 } },
              "in": { "Array": { "items": { "Bin": {} } } },
              "nin": { "Array": { "items": { "Bin": {} } } },
              "query": { "Bool": {} },
              "bit": { "Bool": {} },
              "ord": { "Bool": {} },
              "size": { "Bool": {} }
            }
          }
        },
        "Array": {
          "Map": {
            "comment": "The Array type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Array": {} },
              "contains": { "Array": { "items": { "Ref": "Validator" } } },
              "items": { "Ref": "Validator" },
              "prefix": { "Array": { "items": { "Ref": "Validator" } } },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "min_len": { "Int": { "min": 0, "max": 4294967295 } },
              "in": { "Array": { "items": { "Array": {} } } },
              "nin": { "Array": { "items": { "Array": {} } } },
              "unique": { "Bool": {} },
              "query": { "Bool": {} },
              "array": { "Bool": {} },
              "contains_ok": { "Bool": {} },
              "unique_ok": { "Bool": {} },
              "size": { "Bool": {} }
            }
          }
        },
        "Map": {
          "Map": {
            "comment": "The Map type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Map": { "values": "Any" } },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "min_len": { "Int": { "min": 0, "max": 4294967295 } },
              "keys": { "Map": {
                "comment": "Allowed key strings",
                "opt": {
                  "matches": { "Str": {} },
                  "max_len": { "Int": { "min": 0, "max": 4294967295 } },
                  "min_len": { "Int": { "min": 0, "max": 4294967295 } },
                  "normalize": {
                    "Enum": {
                      "None": null,
                      "NFC": null,
                      "NFKC": null
                    }
                  }
                }
              },
              "values": { "Ref": "Validator" },
              "req": { "Map": { "values": { "Ref": "Validator" } } },
              "opt": { "Map": { "values": { "Ref": "Validator" } } },
              "ban": { "Array": { "items": { "Str": {} } } },
              "in": {
                "Array": { "items": { "Map": { "values": "Any" } } }
              },
              "nin": {
                "Array": { "items": { "Map": { "values": "Any" } } }
              },
              "query": { "Bool": {} },
              "size": { "Bool": {} },
              "map_ok": { "Bool": {} },
              "match_keys": { "Bool": {} },
              "len_keys": { "Bool": {} }
            }
          }
        },
        "Time": {
          "Map": {
            "comment": "The Timestamp type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Time": {} },
              "max": { "Time": {} },
              "min": { "Time": {} },
              "ex_max": { "Bool": {} },
              "ex_min": { "Bool": {} },
              "in": { "Array": { "items": { "Time": {} } } },
              "nin": { "Array": { "items": { "Time": {} } } },
              "query": { "Bool": {} },
              "ord": { "Bool": {} }
            }
          }
        },
        "Hash": {
          "Map": {
            "comment": "The Hash type validator",
            "opt": {
              "comment": { "Str": {} },
              "default": { "Hash": {} },
              "link": { "Ref": "Validator" },
              "schema": { "Array": { "items": { "Multi": [ { "Hash": {}}, "Null" ] } } },
              "in": { "Array": { "items": { "Hash": {} } } },
              "nin": { "Array": { "items": { "Hash": {} } } },
              "query": { "Bool": {} },
              "link_ok": { "Bool": {} },
              "schema_ok": { "Bool": {} }
            }
          }
        },
        "Identity": {
          "Map": {
            "comment": "The Identity type validator",
            "opt": {
              "comment": { "Str": {} },
              "in": { "Array": { "items": { "Identity": {} } } },
              "nin": { "Array": { "items": { "Identity": {} } } },
              "query": { "Bool": {} }
            }
          }
        },
        "StreamId": {
          "Map": {
            "comment": "The StreamId type validator",
            "opt": {
              "comment": { "Str": {} },
              "in": { "Array": { "items": { "StreamId": {} } } },
              "nin": { "Array": { "items": { "StreamId": {} } } },
              "query": { "Bool": {} }
            }
          }
        },
        "LockId": {
          "Map": {
            "comment": "The LockId type validator",
            "opt": {
              "comment": { "Str": {} },
              "in": { "Array": { "items": { "LockId": {} } } },
              "nin": { "Array": { "items": { "LockId": {} } } },
              "query": { "Bool": {} }
            }
          }
        },
        "DataLockbox": {
          "Map": {
            "comment": "The DataLockbox type validator",
            "opt": {
              "comment": { "Str": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "size": { "Bool": {} }
            }
          }
        },
        "IdentityLockbox": {
          "Map": {
            "comment": "The IdentityLockbox type validator",
            "opt": {
              "comment": { "Str": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "size": { "Bool": {} }
            }
          }
        },
        "StreamLockbox": {
          "Map": {
            "comment": "The StreamLockbox type validator",
            "opt": {
              "comment": { "Str": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "size": { "Bool": {} }
            }
          }
        },
        "LockLockbox": {
          "Map": {
            "comment": "The LockLockbox type validator",
            "opt": {
              "comment": { "Str": {} },
              "max_len": { "Int": { "min": 0, "max": 4294967295 } },
              "size": { "Bool": {} }
            }
          }
        },
        "Any": null,
        "Ref": { "Str": {} },
        "Enum": {
          "Map": {
            "values": { "Multi": ["Null", { "Ref": "Validator" }] }
          }
        },
        "Multi": {
          "Array": {
            "comment": "An array of validators. Matching any will validate.",
            "items": { "Ref": "Validator" }
          }
        }
      }
    }
  }
}