pub async fn serve<F: FunctionRunnerService>(
function: F,
args: &Args,
) -> Result<(), Error>Expand description
Starts a gRPC server and serves RunFunctionRequests until SIGTERM or SIGINT, then shuts down gracefully.
Serves with mTLS from --tls-certs-dir (tls.crt and tls.key must be the
function’s PEM-encoded certificate and key; ca.crt a PEM-encoded CA used
to authenticate Crossplane) unless --insecure is set. gRPC server
reflection is enabled for both the v1 and v1alpha reflection APIs, and
the gRPC health service reports the function as serving.
Unless --metrics-address is empty, the gRPC server metrics the Go SDK
serves (grpc_server_started_total and friends, same names and labels)
are served there at /metrics - OpenMetrics 1.0 as the main format, the
classic Prometheus text format for scrapers that ask for it.