Skip to main content

Crate folk_plugin_grpc

Crate folk_plugin_grpc 

Source

Structs§

BytesCodec
A gRPC codec that passes raw protobuf bytes through untouched.
ClientCallEnvelope
Envelope PHP sends to invoke an upstream. client names a [grpc.clients.<name>] entry (resolves the descriptor pool, TLS, default deadline, retries); address optionally overrides the endpoint for this call. message is the request DTO as canonical JSON; it is transcoded to protobuf against the client’s pool.
ClientConfig
Configuration for one named upstream gRPC client ([grpc.clients.<name>]).
ClientRegistry
Per-worker registry of configured upstream clients, keyed by [grpc.clients.<name>] name. Built once per worker run(); each entry lazily opens its channel on first call. Clients whose descriptor pool fails to build are logged and omitted (a call to them returns UNIMPLEMENTED), rather than crashing the worker.
ClientStreamEnvelope
Envelope PHP sends to open a streaming call (grpc.client.stream, phase 88b). Like ClientCallEnvelope plus kind; message carries the single initial request for StreamKind::ServerStreaming and is unused (send messages via folk_stream_send) for client-streaming / bidi.
ClientTlsConfig
Upstream TLS/mTLS settings for a gRPC client.
GrpcConfig
gRPC plugin configuration.
GrpcEnvelope
GrpcPlugin
GrpcState
RetryConfig
Retry policy for a gRPC client (phase 88 §1.4).

Enums§

StreamKind
Which streaming shape grpc.client.stream should open.

Functions§

build_descriptor_pool
Build a DescriptorPool for transcoding from proto files and/or a prebuilt FileDescriptorSet bundle. Both sources merge into one pool (solution 5), so Any can unpack any type present in either. Errors if neither yields any descriptor (transcode was requested but nothing to transcode against).
call_unary
Perform a dynamic unary gRPC call over channel with no message (de)serialization by tonic. request is already-encoded protobuf; the return is the raw response protobuf. Used by the PoC test and by [ResolvedClient].
export_descriptors
Compile proto files and return an encoded FileDescriptorSet (protobuf bytes).
folk_plugin_factory
grpc_handler
json_to_proto
Encode a canonical-JSON value into protobuf bytes (native→proto, response side). Errors if the value doesn’t fit desc.
parse_grpc_timeout
Parse a gRPC grpc-timeout header value into a relative deadline in seconds.
proto_to_json
Decode protobuf bytes into a canonical-JSON value (proto→native, request side). Errors if the bytes don’t match desc or can’t be serialized.