6 #ifndef HTTP_UPLOADER_H
7 #define HTTP_UPLOADER_H
9 #include "tar_gz_creator.h"
18 #define UPLOAD_RETRY_COUNT 2
48 HttpUploader(
const std::string& conf_path,
const std::string& uploader_name);
66 std::map<std::string, std::vector<std::string>> lensaipublisherConfig;
69 std::thread upload_thread_;
70 std::mutex upload_mutex_;
72 std::atomic<bool> exitUploadLoop;
74 std::string uploader_name_;
84 bool postFile(
const std::string& filePath,
const std::string& sensorId, time_t timestamp,
const std::string& fileType);
91 bool uploadFolder(
int &index);
The HttpUploader class handles uploading files to an HTTP server.
Definition: http_uploader.h:36
HttpUploader(const std::string &conf_path, const std::string &uploader_name)
Constructor for HttpUploader.
Definition: http_uploader.cpp:51
void StartUpload()
Starts the upload process in a separate thread.
Definition: http_uploader.cpp:90
~HttpUploader()
Destructor for HttpUploader.
Definition: http_uploader.cpp:35
void StopUpload()
Stops the upload process by joining the upload thread.
Definition: http_uploader.cpp:136
void UploadLoop()
The main loop for uploading files, executed in a separate thread.
Definition: http_uploader.cpp:100
Struct to hold HTTP uploader configuration data.
Definition: http_uploader.h:23
std::string sensorId
Sensor ID to be used in the upload.
Definition: http_uploader.h:27
int interval
Interval in seconds between uploads.
Definition: http_uploader.h:30
std::string endpointUrl
URL of the HTTP endpoint.
Definition: http_uploader.h:24
std::string token
Authorization token.
Definition: http_uploader.h:25
std::vector< std::string > fileType
File types to upload.
Definition: http_uploader.h:28
std::vector< std::string > folderPath
Paths of the folders to upload.
Definition: http_uploader.h:26
std::vector< bool > deletedata
Flags to indicate whether to delete data after upload.
Definition: http_uploader.h:29