grpc Binding
grpc Binding
Zilla runtime grpc binding.
grpc_server:
type: grpc
kind: server
options:
services:
- proto/echo.proto
routes:
- when:
- method: example.EchoService/*
metadata:
custom-text: custom value
custom-binary:
base64: Y3VzdG9tIHZhbHVl
exit: echo_server
Summary
Defines a binding with grpc protocol support, with server or client behavior.
The server kind grpc binding adapts http request-response streams to grpc request-response streams, with support for both application/grpc+proto and application/grpc-web+proto content types.
The client kind grpc binding adapts grpc request-response streams to http request-response streams.
Configuration
kind*
enum[ "client", "server" ]
Behave as a grpc client or server.
kind: server
options
object
grpc-specific options.
options:
services:
- proto/echo.proto
options.services
arrayofstring
Protobuf service definition filenames, typically with .proto filename extension.
exit
string
Default exit binding when no conditional routes are viable.
exit: echo_server
routes
arrayofobject
Conditional grpc-specific routes.
routes:
- guarded:
test:
- echo:messages
when:
- method: example.EchoService/*
metadata:
custom-text: custom value
custom-binary:
base64: Y3VzdG9tIHZhbHVl
exit: echo_server
routes[].guarded
objectas named map ofstring:stringarray
Roles required by named guard.
routes:
- guarded:
test:
- echo:messages
routes[].when
arrayofobject
List of conditions (any match) to match this route.
Read more: When a route matches
routes:
when:
- method: example.EchoService/*
metadata:
custom-text: custom value
custom-binary:
base64: Y3VzdG9tIHZhbHVl
when[].method
string
gRPC service method name, such as example.EchoService/EchoUnary, or service method pattern such as example.EchoService/*.
when[].metadata
objectof name-value headers
Metadata header name value pairs (all match).
Each metadata header value can be string or object with base64 property.
metadata.base64
string
Base64 encoded value for binary metadata header.
routes[].exit*
string
Routed exit binding when conditional route matches.
routes:
- when:
...
exit: echo_server
* required

