This PR refactors the HTTP clients and adds an implementation for Linux using Curl (issue #5). There are the following changes:
Separate out the Windows, and Apple implementations to separate classes (HttpClientWindows, HttpClientApple) that implement an abstract base class HttpClient
Move HTTP client-related classes to a http subfolder (similar to Java tracker)
Enable passing a custom HttpClient as the last optional argument in the Emitter constructor. It is passed as a C++ unique pointer which means that the Emitter will take ownership of the pointer and it will be deleted when the Emitter instance is deleted. My assumption is that HTTP clients belong to Emitters.
Add a HttpClientCurl implementation of HttpClient that uses the easy interface in the Curl library. It is used by default on non-Windows and non-Apple systems.
So far, we don't have integration tests in the tracker, so I didn't add any tests for the new Curl client. It can be tested using the example app by running ./build/example/tracker_example 127.0.0.1:9090 after make. I want to add integration tests using Micro and CI on Linux in other issues so that this PR doesn't get too bloated.
Thanks @AlexBenny! The Linux support is not yet complete, there still remain some other places to add support (desktop context, CI). I will update the documentation at once in issue #50
This PR refactors the HTTP clients and adds an implementation for Linux using Curl (issue #5). There are the following changes:
HttpClientWindows
,HttpClientApple
) that implement an abstract base classHttpClient
http
subfolder (similar to Java tracker)HttpClient
as the last optional argument in theEmitter
constructor. It is passed as a C++ unique pointer which means that the Emitter will take ownership of the pointer and it will be deleted when the Emitter instance is deleted. My assumption is that HTTP clients belong to Emitters.HttpClientCurl
implementation ofHttpClient
that uses the easy interface in the Curl library. It is used by default on non-Windows and non-Apple systems.So far, we don't have integration tests in the tracker, so I didn't add any tests for the new Curl client. It can be tested using the example app by running
./build/example/tracker_example 127.0.0.1:9090
aftermake
. I want to add integration tests using Micro and CI on Linux in other issues so that this PR doesn't get too bloated.I also made a PR with some small docs updates on data-value-resources.