Documentation
¶
Index ¶
- func DropUnknownFields(msg protoreflect.Message)
- func ForEachUnknownField(msg protoreflect.Message, cb func(msg protoreflect.Message) bool)
- func MessageHasUnknownFields(msg protoreflect.Message) bool
- func NewInterceptor(opts ...option) *interceptor
- func WithCallback(callback UnknownCallback) option
- func WithDrop() option
- type UnknownCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropUnknownFields ¶ added in v0.0.6
func DropUnknownFields(msg protoreflect.Message)
DropUnknownFields recursively drops any unknown fields from the provided protobuf message.
func ForEachUnknownField ¶ added in v0.0.7
func ForEachUnknownField(msg protoreflect.Message, cb func(msg protoreflect.Message) bool)
ForEachUnknownField recursively scans the given protoreflect.Message object for unknown fields and calls the given callback function when it finds a message containing an unknown field.
func MessageHasUnknownFields ¶
func MessageHasUnknownFields(msg protoreflect.Message) bool
MessageHasUnknownFields returns true if the given protoreflect.Message has any unknown fields.
func NewInterceptor ¶
func NewInterceptor(opts ...option) *interceptor
NewInterceptor creates a new interceptor appropriate to pass into a new ConnectRPC client or server. The given callback is called whenever a message is detected to have an unknown field. That means a field is being given to this client/server that does not. The callback can decide what to do. Any error returned from the callback will be used as an error in the request or response.
func WithCallback ¶ added in v0.0.7
func WithCallback(callback UnknownCallback) option
Types ¶
type UnknownCallback ¶
UnknownCallback is called whenever there is an unknown field. Note that the proto.Message is the base protobuf message for the RPC call. The message with the unknown field(s) can be nested deeper into this given message.