# EnvoyDataPlaneApi
Protobuf definitions for the Envoy data plane API.
Can be used to parse/generate Envoy configuration files or to implement
control plane servers using gRPC.
The definitions are generated by pulling the official [data-plane-api](https://github.com/envoyproxy/data-plane-api)
repository, and using [`buf`](https://buf.build/) to handle dependencies run the code generation.
The Elixir code is generated using the [protobuf](https://github.com/elixir-protobuf/protobuf)
library, and it also depends on the [grpc](https://github.com/elixir-grpc/grpc) and
the [google_protos](https://github.com/elixir-protobuf/google-protos) libraries.
## Example
Here is a simple example of how to use the generated code to parse the
`/config_dump` endpoint of Envoy's admin API:
```elixir
Mix.install([:req, :jason, :envoy_data_plane_api])
config_dump =
"http://my_envoy_server:8001/config_dump"
|> Req.get!()
|> then(& &1.body)
|> Protobuf.JSON.decode!(Envoy.Admin.V3.ConfigDump)
```
## Installation
The package can be installed by adding `envoy_data_plane_api` to your list
of dependencies in `mix.exs`:
```elixir
def deps do
[
{:envoy_data_plane_api, "~> 0.1.0"}
]
end
```
The docs can be found at <https://hexdocs.pm/envoy_data_plane_api>.