Routemaster Client v0.3.0 Routemaster.Config View Source

Centralized access to the client configuration.

Link to this section Summary

Functions

The HTTP Basic Authorization Header value to authenticate requests to the event bus server. It’s derived from a base64-encoded Config.bus_api_token

The API token to authenticate requests to the event bus server

The HTTPS URL of the Routemaster event bus server

The cache TTL, as an integer number of seconds represented as a string. Defaults to one day (86400 seconds)

Options passed to the Director’s hackney adapter. See the hackney docs for more details

The auth token used by the Drain to authenticate incoming HTTP requests. This token is specific to this application (an event consumer, AKA subscriber)

The HTTPS URL where this application will mount the Drain app. This is usually a path, and that is where the event bus server will send HTTP POST requests to deliver events

Options passed to the Fetcher’s hackney adapter. See the hackney docs for more details

Options passed to the Publisher’s hackney adapter. See the hackney docs for more details

Returns the connection condfiguration for Redis. It could be either a Keyword List of parameters or a binary URI

Authentication credentials for other services with which we’re going to interact. These are usually the origins or sources of the entities linked to in the events

For the given hostname, it returns a HTTP Authorization header value. The hostname must be found in the credentials Map returned by service_auth_credentials/0

The user-agent HTTP header used when talking with the bus server and when fetching entities from their URLs

Link to this section Functions

Link to this function bus_api_auth_header() View Source
bus_api_auth_header() :: binary()

The HTTP Basic Authorization Header value to authenticate requests to the event bus server. It’s derived from a base64-encoded Config.bus_api_token.

Link to this function bus_api_token() View Source
bus_api_token() :: binary()

The API token to authenticate requests to the event bus server.

The HTTPS URL of the Routemaster event bus server.

Link to this function cache_ttl() View Source
cache_ttl() :: binary()

The cache TTL, as an integer number of seconds represented as a string. Defaults to one day (86400 seconds).

Link to this function director_http_options() View Source
director_http_options() :: Keyword.t()

Options passed to the Director’s hackney adapter. See the hackney docs for more details.

Link to this function drain_token() View Source
drain_token() :: binary()

The auth token used by the Drain to authenticate incoming HTTP requests. This token is specific to this application (an event consumer, AKA subscriber).

This token is sent to the event bus server when subscribing to topics, where it will be stored with this subscriber’s metadata. Later, when delivering events, the server will send it back in the HTTP Authorization header of the POST requests to this drain.

Link to this function drain_url() View Source
drain_url() :: binary()

The HTTPS URL where this application will mount the Drain app. This is usually a path, and that is where the event bus server will send HTTP POST requests to deliver events.

This URL is sent to the event bus server when subscribing to topics.

Link to this function fetcher_http_options() View Source
fetcher_http_options() :: Keyword.t()

Options passed to the Fetcher’s hackney adapter. See the hackney docs for more details.

Link to this function publisher_http_options() View Source
publisher_http_options() :: Keyword.t()

Options passed to the Publisher’s hackney adapter. See the hackney docs for more details.

Link to this function redis_config(type) View Source
redis_config(atom()) :: binary() | Keyword.t()

Returns the connection condfiguration for Redis. It could be either a Keyword List of parameters or a binary URI.

Link to this function service_auth_credentials() View Source
service_auth_credentials() :: %{optional(binary()) => binary()}

Authentication credentials for other services with which we’re going to interact. These are usually the origins or sources of the entities linked to in the events.

It returns a Map where the keys are the hostnames of the other services (binaries) and the values are the pre-built values for the HTTP Authorization header.

The credentials need to be configured beforehand.

Link to this function service_auth_for(host) View Source
service_auth_for(binary()) :: {:ok, binary()} | :error

For the given hostname, it returns a HTTP Authorization header value. The hostname must be found in the credentials Map returned by service_auth_credentials/0

Link to this function user_agent() View Source
user_agent() :: binary()

The user-agent HTTP header used when talking with the bus server and when fetching entities from their URLs.