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
def deps do
[
{:cratis_chronicle_contracts, "~> 0.1.0"}
]
endWhat Is In The Package
lib/generatedcontains the generated protobuf message modules and*.StubgRPC client modules.
Generating The Elixir Client
From the repository root:
cd Source/Clients/Elixir
bash ./generate-protos.shThe script:
-
Copies
Source/Kernel/Protobufintopriv/protos -
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:
{: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.