{"id":28861297,"url":"https://github.com/elixir-grpc/grpc-reflection","last_synced_at":"2025-10-20T05:36:29.656Z","repository":{"id":206849621,"uuid":"717833028","full_name":"elixir-grpc/grpc-reflection","owner":"elixir-grpc","description":"elixir graph reflection support","archived":false,"fork":false,"pushed_at":"2025-06-18T23:25:13.000Z","size":151,"stargazers_count":11,"open_issues_count":4,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-19T00:25:51.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-grpc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-12T18:35:09.000Z","updated_at":"2025-06-18T23:25:00.000Z","dependencies_parsed_at":"2024-03-17T02:17:41.959Z","dependency_job_id":"46eabe50-75e6-43d0-b01e-6a50d6ecb72d","html_url":"https://github.com/elixir-grpc/grpc-reflection","commit_stats":null,"previous_names":["mjheilmann/grpc-reflection","elixir-grpc/grpc-reflection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-grpc/grpc-reflection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-grpc%2Fgrpc-reflection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-grpc%2Fgrpc-reflection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-grpc%2Fgrpc-reflection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-grpc%2Fgrpc-reflection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-grpc","download_url":"https://codeload.github.com/elixir-grpc/grpc-reflection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-grpc%2Fgrpc-reflection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260659207,"owners_count":23043459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-20T05:06:07.065Z","updated_at":"2025-10-20T05:36:29.650Z","avatar_url":"https://github.com/elixir-grpc.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrpcReflection\n\n[![GitHub CI](https://github.com/elixir-grpc/grpc-reflection/actions/workflows/ci.yml/badge.svg)](https://github.com/elixir-grpc/grpc-reflection/actions/workflows/ci.yml)\n[![Hex.pm](https://img.shields.io/hexpm/v/grpc_reflection.svg)](https://hex.pm/packages/grpc_reflection)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/grpc_reflection/)\n[![License](https://img.shields.io/hexpm/l/grpc_reflection.svg)](https://github.com/elixir-grpc/grpc-reflection/blob/main/LICENSE)\n[![Total Downloads](https://img.shields.io/hexpm/dt/grpc_reflection.svg)](https://hex.pm/packages/grpc_reflection)\n\nServer reflection allows servers to assist clients in runtime construction of requests without having stub information precompiled into the client.\n\nAccording to the [GRPC Server Reflection Protocol\n](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md), the primary usecase for server reflection is to write (typically) command line debugging tools for talking to a grpc server. In particular, such a tool will take in a method and a payload (in human readable text format) send it to the server (typically in binary proto wire format), and then take the response and decode it to text to present to the user.\n\nGrpcReflection adds reflection support to applications built with [grpc-elixir](https://hex.pm/packages/grpc). It is a supervised application that can be implemented as a gRPC server using [grpc-elixir](https://github.com/elixir-grpc/grpc).\n\n## Installation\n\nThe package can be installed by adding `grpc_reflection` to your list of dependencies in `mix.exs`:\n\n```elixir\n{:grpc_reflection, \"~\u003e 0.2\"}\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/grpc_reflection\u003e.\n\n# Reflection\n\nThis is written and tested using [grpcurl](https://github.com/fullstorydev/grpcurl) and [postman](https://www.postman.com). It supports both v1alpha and v1 reflection by using one or both of the provided servers: `rpcReflection.V1.Server` or `rpcReflection.V1alpha.Server`\n\n## Enable reflection on your application\n\n1. Rebuild your protos with descriptors enabled. Each module and/or service that you would like to expose through reflection must use the protoc elixir-out option `gen_descriptors=true`.\n\n1. Create a reflection server\n\n   ```elixir\n   defmodule Helloworld.Reflection.Server do\n     use GrpcReflection.Server,\n       version: :v1,\n       services: [Helloworld.Greeter.Service]\n   end\n   ```\n\n   | Config Option | Description |\n   | :---: | --- |\n   | `version`     | Either `:v1` or `:v1alpha`, depending on intended client support.       |\n   | `services`    | This is a list of GRPC services that should be included for reflection. |\n\n1. Add the reflection supervisor to your supervision tree to host the cached reflection state\n\n   ```elixir\n   children = [\n     ...other children,\n     GrpcReflection\n   ]\n   ```\n\n1. Add your servers to your grpc endpoint\n\n   ```elixir\n     run(Helloworld.Reflection.Server)\n   ```\n\n## Interacting with your reflection server\n\nHere are some examples using [grpcurl](https://github.com/fullstorydev/grpcurl) to demonstrate the reflection capabilities:\n\n```shell\n$ grpcurl -v -plaintext 127.0.0.1:50051 list\nhelloworld.Greeter\n\n$ grpcurl -v -plaintext 127.0.0.1:50051 list helloworld.Greeter\nhelloworld.Greeter.SayHello\n\n$ grpcurl -v -plaintext 127.0.0.1:50051 describe helloworld.Greeter.SayHello\nhelloworld.Greeter.SayHello is a method:\nrpc SayHello ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply );\n\n$ grpcurl -v -plaintext 127.0.0.1:50051 describe .helloworld.HelloReply\nhelloworld.HelloReply is a message:\nmessage HelloReply {\n  optional string message = 1;\n  optional .google.protobuf.Timestamp today = 2;\n}\n\n$ grpcurl -plaintext -format text -d 'name: \"faker\"' localhost:50051 helloworld.Greeter.SayHello\nmessage: \"Hello faker\"\ntoday: \u003c\n  seconds:1708412184 nanos:671267628\n\u003e\n```\n\n## Protobuf Version Support\n\nThis module is more thoroughly tested with proto3, but it has some testing with proto2. In either case feedback is appreciated as we approach full proto support in this module.\n\n## Application Support\n\nThis is **not** an exhaustive list, contributions are appreciated.\n\n| Application | Reflection version required |\n| --- | :---: |\n| [grpcurl](https://github.com/fullstorydev/grpcurl) | V1      |\n| [grpcui](https://github.com/fullstorydev/grpcui)   | V1      |\n| [postman](https://www.postman.com/)                | V1alpha |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-grpc%2Fgrpc-reflection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-grpc%2Fgrpc-reflection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-grpc%2Fgrpc-reflection/lists"}