Brasilapi.Config (BrasilAPI v1.0.2)

Copy Markdown View Source

Configuration module for BrasilAPI client.

Summary

Functions

Returns the base URL for BrasilAPI.

Returns additional Req options for HTTP requests.

Returns the number of retry attempts for failed requests.

Returns retry options for Req based on the configured retry attempts.

Returns the request timeout in milliseconds.

Functions

base_url()

@spec base_url() :: String.t()

Returns the base URL for BrasilAPI.

Can be overridden via application environment or system environment.

req_options()

@spec req_options() :: keyword()

Returns additional Req options for HTTP requests.

retry_attempts()

@spec retry_attempts() :: non_neg_integer()

Returns the number of retry attempts for failed requests.

retry_options()

@spec retry_options() :: keyword()

Returns retry options for Req based on the configured retry attempts.

Retries are disabled automatically in test environment to keep tests fast and avoid repeated network failures against Bypass.

timeout()

@spec timeout() :: pos_integer()

Returns the request timeout in milliseconds.