Idiomatic API for registering external service definitions with Chronicle.
External services let the Chronicle kernel talk to systems outside the event store — an HTTP API or a MsSql/PostgreSql database — under a name other kernel features (such as captures) can reference.
Registration
:ok =
Chronicle.ExternalServices.register("payments-api", fn builder ->
builder
|> Chronicle.ExternalServices.DefinitionBuilder.http("https://payments.example.com")
|> Chronicle.ExternalServices.DefinitionBuilder.with_bearer_token(
System.fetch_env!("PAYMENTS_API_TOKEN")
)
end)Options
:client— the client name (default:Chronicle.Client)
Summary
Functions
Registers an external service.
Functions
@spec register( String.t(), (Chronicle.ExternalServices.DefinitionBuilder.t() -> Chronicle.ExternalServices.DefinitionBuilder.t()), keyword() ) :: :ok | {:error, term()}
Registers an external service.
configure receives a Chronicle.ExternalServices.DefinitionBuilder and
must return it (or a continuation of it) after configuring the endpoint.