package ocaml-protoc-plugin

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Google.Protobuf

module FileDescriptorSet : sig ... end

The protocol compiler can output a FileDescriptorSet containing the .proto files it parses.

module FileDescriptorProto : sig ... end

Describes a complete .proto file.

module DescriptorProto : sig ... end

Describes a message type.

module ExtensionRangeOptions : sig ... end
module FieldDescriptorProto : sig ... end

Describes a field within a message.

module OneofDescriptorProto : sig ... end

Describes a oneof.

module EnumDescriptorProto : sig ... end

Describes an enum type.

module EnumValueDescriptorProto : sig ... end

Describes a value within an enum.

module ServiceDescriptorProto : sig ... end

Describes a service.

module MethodDescriptorProto : sig ... end

Describes a method of a service.

module FileOptions : sig ... end

=================================================================== Options

Each of the definitions above may have "options" attached. These are just annotations which may cause code to be generated slightly differently or may contain hints for code that manipulates protocol messages.

Clients may define custom options as extensions of the *Options messages. These extensions may not yet be known at parsing time, so the parser cannot store the values in them. Instead it stores them in a field in the *Options message called uninterpreted_option. This field must have the same name across all *Options messages. We then use this field to populate the extensions when we build a descriptor, at which point all protos have been parsed and so all extensions are known.

Extension numbers for custom options may be chosen as follows:

  • For options which will only be used within a single application or

    organization, or for experimental options, use field numbers 50000 through 99999. It is up to you to ensure that you do not use the same number for multiple options.

  • For options which will be published and used publicly by multiple

    independent entities, e-mail protobuf-global-extension-registry@google.com to reserve extension numbers. Simply provide your project name (e.g. Objective-C plugin) and your project website (if available) -- there's no need to explain how you intend to use them. Usually you only need one extension number. You can declare multiple options with only one extension number by putting them in a sub-message. See the Custom Options section of the docs for examples: https://developers.google.com/protocol-buffers/docs/proto#options If this turns out to be popular, a web service will be set up to automatically assign option numbers.

module MessageOptions : sig ... end
module FieldOptions : sig ... end
module OneofOptions : sig ... end
module EnumOptions : sig ... end
module EnumValueOptions : sig ... end
module ServiceOptions : sig ... end
module MethodOptions : sig ... end
module UninterpretedOption : sig ... end

A message representing a option the parser does not recognize. This only appears in options protos created by the compiler::Parser class. DescriptorPool resolves these when building Descriptor objects. Therefore, options protos in descriptor objects (e.g. returned by Descriptor::options(), or produced by Descriptor::CopyTo()) will never have UninterpretedOptions in them.

module SourceCodeInfo : sig ... end

Encapsulates information about the original source file from which a FileDescriptorProto was generated.

=================================================================== Optional source code info

module GeneratedCodeInfo : sig ... end

Describes the relationship between generated code and its original source file. A GeneratedCodeInfo message is associated with only one generated source file, but may contain references to different source .proto files.