Packages
cratis_chronicle_contracts
16.0.1
16.7.0
16.6.1
16.6.0
16.5.0
16.4.1
16.4.0
16.3.1
16.3.0
16.2.1
16.2.0
16.1.1
16.1.0
16.0.6
16.0.5
16.0.4
16.0.3
16.0.2
16.0.1
16.0.0
15.41.0
15.40.0
15.39.1
15.39.0
15.38.4
15.38.3
15.38.2
15.38.1
15.38.0
15.37.0
15.36.1
15.36.0
15.35.8
15.35.7
15.35.6
15.35.5
15.35.4
15.35.3
15.35.2
15.35.1
15.35.0
15.34.13
15.34.12
15.34.11
15.34.10
15.34.9
15.34.8
15.34.7
15.34.6
15.34.5
15.34.4
15.34.3
15.34.2
15.31.5
15.31.4
15.31.3
15.31.2
15.31.1
15.31.0
15.30.2
15.30.1
15.30.0
15.29.8
15.29.7
15.29.6
15.29.4
15.29.3
15.29.2
15.29.1
15.29.0
15.28.0
15.27.3
15.27.2
15.27.1
15.27.0
15.26.11
15.26.10
15.26.9
15.26.8
15.26.7
15.26.6
15.26.5
15.26.4
15.26.3
15.26.1
15.25.5
15.25.4
15.25.3
Generated Elixir gRPC contracts for Chronicle
Current section
Files
Jump to
Current section
Files
cratis_chronicle_contracts
README.md
README.md
# cratis_chronicle_contracts
Generated Chronicle gRPC contracts for Elixir.
This package is intentionally non-idiomatic. Its job is to expose generated
protobuf and gRPC client modules that an idiomatic Elixir client can build on
top of later.
## Installation
```elixir
def deps do
[
{:cratis_chronicle_contracts, "~> 0.1.0"}
]
end
```
## What Is In The Package
- `lib/generated` contains the generated protobuf message modules and `*.Stub`
gRPC client modules.
## Generating The Elixir Client
From the repository root:
```bash
cd Source/Clients/Elixir
bash ./generate-protos.sh
```
The script:
1. Copies `Source/Kernel/Protobuf` into `priv/protos`
2. Generates Elixir protobuf and gRPC modules into `lib/generated`
The generated files are not meant to be edited by hand.
## Using Generated Stubs
After generating the Elixir sources, use the generated `*.Stub` modules under
`Cratis.Chronicle.Contracts.*` with the channel returned by
your gRPC connection/channel implementation.
For example, after generation you can call the generated services like this:
```elixir
{:ok, response} =
Cratis.Chronicle.Contracts.EventStores.Stub.get_event_stores(
channel,
Google.Protobuf.Empty.new()
)
```
## Publishing
The repository contains a dedicated GitHub Actions workflow for publishing this
package to Hex. The publish flow regenerates the Elixir sources from the current
proto files before running tests and `mix hex.publish --yes`.