ProtoExtensionRegistry

Available in a dev version: 0․11․0-grpc-186

How to configure

Runtime registry of known extension descriptors.

The registry can be passed to a ProtoConfig to enable extension parsing. During decoding, the protobuf runtime looks up extension descriptors by (message type, field number) and delegates parsing to the matching descriptor.

A registry can be created using ProtoExtensionRegistry.

Example:

val registry = ProtoExtensionRegistry {
+MyFileExtensions.myExtension
+MyFileExtensions.anotherExtension
}
val config = ProtoConfig(extensionRegistry = registry)

Types

Link copied to clipboard
inner class Builder

Mutable builder used to register descriptors into this registry.

Functions

Link copied to clipboard

Returns all registered extensions for messageType, keyed by field number.