package ocaml-protoc-plugin

  1. Overview
  2. Docs

Describes a complete .proto file.

type t = {
  1. name : string option;
    (*

    file name, relative to root of source tree

    *)
  2. package : string option;
    (*

    e.g. "foo", "foo.bar", etc.

    *)
  3. dependency : string list;
    (*

    Names of files imported by this file.

    *)
  4. message_type : DescriptorProto.t list;
    (*

    All top-level definitions in this file.

    *)
  5. enum_type : EnumDescriptorProto.t list;
  6. service : ServiceDescriptorProto.t list;
  7. extension : FieldDescriptorProto.t list;
  8. options : FileOptions.t option;
  9. source_code_info : SourceCodeInfo.t option;
    (*

    This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

    *)
  10. public_dependency : int list;
    (*

    Indexes of the public imported files in the dependency list above.

    *)
  11. weak_dependency : int list;
    (*

    Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

    *)
  12. syntax : string option;
    (*

    The syntax of the proto file. The supported values are "proto2" and "proto3".

    *)
}
val make : ?name:string -> ?package:string -> ?dependency:string list -> ?message_type:DescriptorProto.t list -> ?enum_type:EnumDescriptorProto.t list -> ?service:ServiceDescriptorProto.t list -> ?extension:FieldDescriptorProto.t list -> ?options:FileOptions.t -> ?source_code_info:SourceCodeInfo.t -> ?public_dependency:int list -> ?weak_dependency:int list -> ?syntax:string -> unit -> t

Helper function to generate a message using default values

Serialize the message to binary format

val from_proto : Ocaml_protoc_plugin.Reader.t -> (t, [> Ocaml_protoc_plugin.Result.error ]) Stdlib.result

Deserialize from binary format

Serialize to Json (compatible with Yojson.Basic.t)

val from_json : Ocaml_protoc_plugin.Json.t -> (t, [> Ocaml_protoc_plugin.Result.error ]) Stdlib.result

Deserialize from Json (compatible with Yojson.Basic.t)

val name : unit -> string

Fully qualified protobuf name of this message

OCaml

Innovation. Community. Security.