View Source GrpcReflection (grpc_reflection v0.1.4)

Reflection support for the grpc-elixir package

To use these servers, all protos must be compiled with the gen_descriptors=true option, as that is the source of truth for the reflection service.

To turn on reflection in your application, do the following:

  1. Create your reflection server

    defmodule Helloworld.Reflection.Server do
    use GrpcReflection.Server,
     version: :v1,
     services: [Helloworld.Greeter.Service]
    end
  2. Add the reflection supervisor to your supervision tree

    children = [
    {GRPC.Server.Supervisor, endpoint: Helloworld.Endpoint, port: 50051, start_server: true},
    GrpcReflection
    ]
  3. Add your reflection server to your endpoint

    defmodule Helloworld.Endpoint do
    use GRPC.Endpoint
    
    intercept(GRPC.Server.Interceptors.Logger)
    run(Helloworld.Greeter.Server)
    run(Helloworld.Reflection.Server)
    end