-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaces mojito(deprecated) with finch default http client (#6)
* replaces mojito(deprecated) with finch default http client * update readme and changelog * circleci not used anymore Co-authored-by: Dan McGuire <[email protected]> Co-authored-by: James Dalton <[email protected]>
- Loading branch information
1 parent
5f8596e
commit 400d134
Showing
9 changed files
with
99 additions
and
122 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
### Changelog: | ||
# Changelog | ||
|
||
#### v0.2.2 | ||
## v0.2.4 (2022-05-23) | ||
|
||
- Switch from mojito to finch since mojito is deprecated | ||
- bump lib versions | ||
- jason | ||
- ex_doc | ||
- stream_data | ||
- yaml_elixir | ||
- telemetry | ||
- mox | ||
|
||
## v0.2.2 | ||
|
||
- hex release | ||
|
||
#### v0.2.1 | ||
## v0.2.1 | ||
|
||
- allow dry run | ||
|
||
#### v0.2.0 | ||
## v0.2.0 | ||
|
||
- Support for CONSUL_PREFIX | ||
- Breaking changes | ||
- Changes how tranforms are done | ||
|
||
#### v0.1.4 | ||
## v0.1.4 | ||
|
||
- Namespace modules by `ConsulConfigProvider` (https://github.com/blueshift-labs/consul_config_provider/pull/1) | ||
- Do not force compiling the request function (https://github.com/blueshift-labs/consul_config_provider/pull/2) | ||
- Namespace modules by `ConsulConfigProvider` [#1](https://github.com/blueshift-labs/consul_config_provider/pull/1) | ||
- Do not force compiling the request function [#2](https://github.com/blueshift-labs/consul_config_provider/pull/2) | ||
- README.md updates | ||
|
||
#### v0.1.3 | ||
## v0.1.3 | ||
|
||
- Adding in ConsulConfigProvider.Transformer behaviour | ||
|
||
#### v0.1.2 | ||
## v0.1.2 | ||
|
||
- Updating README.md and recursive string_atoms | ||
|
||
#### v0.1.1 | ||
## v0.1.1 | ||
|
||
- Upgrading mojito version to 0.6.0 and refactoring | ||
|
||
#### v0.1.0 | ||
## v0.1.0 | ||
|
||
- Initial implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
defmodule ConsulConfigProvider.Client.Finch do | ||
@moduledoc "Http client using finch" | ||
@behaviour ConsulConfigProvider.Http | ||
@compile {:inline, request: 1} | ||
|
||
if match?({:module, _}, Code.ensure_compiled(Finch)) do | ||
@impl true | ||
def request(method: method, url: url) do | ||
{:ok, _} = Application.ensure_all_started(:telemetry) | ||
pid = Process.whereis(ConsulConfigDefaultHTTPClient) | ||
|
||
if pid == nil do | ||
Finch.start_link(name: ConsulConfigDefaultHTTPClient) | ||
end | ||
|
||
headers = [{"Content-Type", "application/json"}] | ||
pool_opts = %{default: [max_idle_time: 60_000, size: 10, count: 1]} | ||
finch_req = Finch.build(method, url, headers, nil, [pools: pool_opts]) | ||
{:ok, %Finch.Response{body: body}} = Finch.request(finch_req, ConsulConfigDefaultHTTPClient) | ||
{:ok, body} | ||
end | ||
else | ||
@impl true | ||
def request(_request_opts) do | ||
{:error, :finch_not_compiled} | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.