GrpcMarshallerConfig
Available in a dev version: 0․11․0-grpc-186
How to configure
A marker interface for configurations passed to GrpcMarshallers during encoding and decoding operations.
Implementations of this interface can provide marshaller-specific configuration options that control the behavior of message serialization and deserialization. Each marshaller implementation may support different configuration options by defining its own GrpcMarshallerConfig subtype.
Configuration can be passed to marshallers in two ways:
Per-operation: directly to GrpcMarshaller.encode and GrpcMarshaller.decode methods
As default: when retrieving a marshaller using grpcMarshallerOf, which wraps the marshaller to use the config by default
Example:
// Per-operation config
val marshaller = grpcMarshallerOf<MyProtoMessage>()
val encoded = marshaller.encode(message, ProtoConfig(discardUnknownFields = true))
// Default config
val marshallerWithConfig = grpcMarshallerOf<MyProtoMessage>(ProtoConfig(discardUnknownFields = true))
val encoded = marshallerWithConfig.encode(message) // uses the default configContent copied to clipboard