View Source GRPC.Endpoint (grpc v0.8.1)

GRPC endpoint for multiple servers and interceptors.

Usage

defmodule Your.Endpoint do
  use GRPC.Endpoint

  intercept GRPC.Server.Interceptors.Logger, level: :info
  intercept Other.Interceptor
  run HelloServer, interceptors: [HelloHaltInterceptor]
  run FeatureServer
end

Interceptors will be run around your rpc calls from top to bottom. And you can even set interceptors for some of servers. In the above example, [GRPC.Server.Interceptors.Logger, Other.Interceptor, HelloHaltInterceptor] will be run for HelloServer, and [GRPC.Server.Interceptors.Logger, Other.Interceptor] will be run for FeatureServer.

Summary

Functions

Options

opts keyword will be passed to Interceptor's init/1

Options

  • :interceptors - custom interceptors for these servers

Functions

Link to this macro

intercept(name)

View Source (macro)
Link to this macro

intercept(name, opts)

View Source (macro)

Options

opts keyword will be passed to Interceptor's init/1

Link to this macro

run(servers, opts \\ [])

View Source (macro)

Options

  • :interceptors - custom interceptors for these servers