chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 27 forks source link

Add adapter to opts, allowing to add custom configuration to the adapter #39

Closed gabrielpra1 closed 4 years ago

gabrielpra1 commented 4 years ago

We have 3 options to set custom configuration for the adapters in Tesla: https://github.com/teamon/tesla#adapter-options

Currently, this lib only allows the adapter to be set through config.exs, but through this way it's not possible to set custom opts, so passing the adapter with options when building the client seems to be the easiest way to do this.

My use case is to increase hackney timeout, like this:

ExForce.build_client(oauth_response, api_version: version, adapter: {Tesla.Adapter.Hackney, [recv_timeout: timeout()]})
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 509d73c33d3b7c09a23a1084476d49ee37952e7b on gabrielpra1:add-adapter-opts into 467de59c53130eb9c3703ab8ea2282e0b1884b4c on chulkilee:master.

chulkilee commented 4 years ago

Thanks! :heart: