package ocaml-protoc

  1. Overview
  2. Docs
Pure OCaml compiler for .proto files

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocaml-protoc-4.0.tbz
sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4
sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f

doc/ocaml-protoc.compiler-lib/Ocaml_protoc_compiler_lib/Pb_raw_option/index.html

Module Ocaml_protoc_compiler_lib.Pb_raw_optionSource

Protobuf File/Message/Field raw options (i.e. exactly as they parsed)

Sourcetype name_part =
  1. | Simple_name of string
  2. | Extension_name of string
Sourcetype option_name = name_part list
Sourcetype set = t list
Sourceval stringify_option_name : option_name -> string
Sourceval empty : set
Sourceval add_or_replace : set -> option_name -> Pb_option.value -> set
Sourceval merge : set -> set -> set

merge s1 s2 adds all the options from s2 to s1. This means than in case of duplicates s2 options will override s1 options.

Sourceval get : set -> option_name -> Pb_option.value option
Sourceval get_ext : set -> string -> Pb_option.value option
Sourceval get_simple : set -> string -> Pb_option.value option
Sourceval group_list_values : set -> set

group_list_values set groups options with the same name into Pb_option.List_literal

The following set of options:

  option (google.api.http).additional_bindings = {
      get: "/foo/bar/baz/{id}"
  };
  option (google.api.http).additional_bindings = {
      post: "/foo/bar/baz/"
      body: "*"
  };

Is equivalent to the below non-destructured version:

  option (google.api.http) = {
      additional_bindings: [
        {
            get: "/foo/bar/baz/{id}"
        },
        {
            post: "/foo/bar/baz/"
            body: "*"
        }
      ]
  };
Sourceval pp_t : Format.formatter -> t -> unit
Sourceval pp_set : Format.formatter -> set -> unit