Commit 8ef5aa9c by Amir Aharon

add network to docker-compose and start work

parent 15ae02bf
......@@ -34,6 +34,7 @@
"/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"${workspaceRoot}/../3party",
"${workspaceRoot}/src"
],
"defines": [],
......
......@@ -11,4 +11,9 @@ services:
volumes:
- "./:/home/develop/project"
- "./../3party:/home/develop/3party"
# command: bash
\ No newline at end of file
# command: bash
networks:
- devnet
networks:
devnet:
driver: bridge
\ No newline at end of file
#include "Microservice_IRestServerEvppImpl.h"
#include <signal.h>
static int s_sig_num = 0;
void run_thread(Microservice_IRestServerEvppImpl* pc_Obj)
{
pc_Obj->start();
}
static void signal_handler(int sig_num) {
signal(sig_num, signal_handler);
s_sig_num = sig_num;
}
Microservice_IRestServerEvppImpl::Microservice_IRestServerEvppImpl(cMicroservice_RestServerParams* p_param)
:p_server_(nullptr),p_runThread_(nullptr) {
serverType_.assign(getType());
p_param_ = p_param;
}
bool Microservice_IRestServerEvppImpl::build(std::string& appName, const std::map<std::string,nsMicroservice_Iface::IHandler*>& msHandlersMap,
nsMicroservice_Iface::ILogger* pc_Logger,
nsMicroservice_Iface::IPubSub* pc_PubSub,
nsMicroservice_Iface::IMetricsFactory* p_metrics_factory){
bool result = false;
return result;
}
void Microservice_IRestServerEvppImpl::registerService(nsMicroservice_Iface::IServiceDiscovery* pc_ServiceDiscovery,
std::string& id){
}
void Microservice_IRestServerEvppImpl::run(){
}
void Microservice_IRestServerEvppImpl::start(){
}
void Microservice_IRestServerEvppImpl::stop(){
}
bool Microservice_IRestServerEvppImpl::init(){
return true;
}
\ No newline at end of file
#ifndef MICROSERVICE_IRESTSERVEREVPPIMPL_H
#define MICROSERVICE_IRESTSERVEREVPPIMPL_H
#include "common/Microservice_Iface.h"
#include <common/Microservice_RequestContext.h>
#include "../../params/Microservice_Params.h"
#include <thread>
#include <evpp/http/http_server.h>
class Microservice_IRestServerEvppImpl : public nsMicroservice_Iface::IRestServer , public nsMicroservice_Iface::IContainer {
public:
Microservice_IRestServerEvppImpl(cMicroservice_RestServerParams* p_param);
Microservice_IRestServerEvppImpl(const Microservice_IRestServerEvppImpl& orig) {}
virtual ~Microservice_IRestServerEvppImpl() {}
bool build(std::string& appName, const std::map<std::string,nsMicroservice_Iface::IHandler*>& msHandlersMap,
nsMicroservice_Iface::ILogger* pc_Logger,
nsMicroservice_Iface::IPubSub* pc_PubSub,
nsMicroservice_Iface::IMetricsFactory* p_metrics_factory) override;
void registerService(nsMicroservice_Iface::IServiceDiscovery* pc_ServiceDiscovery, std::string& id) override;
void run() override;
void start();
void stop() override;
virtual bool init() override;
private:
evpp::http::Server* p_server_;
std::thread* p_runThread_;
nsMicroservice_Iface::ILogger* p_logger_;
std::string serverType_;
cMicroservice_RestServerParams* p_param_;
// consts
static constexpr uint32_t SLEEP_INTERVAL = 1; //useconds
};
#endif // MICROSERVICE_IRESTSERVEREVPPIMPL_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment