Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery.common.cpp
/
Microservice
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8ef5aa9c
authored
Jan 22, 2018
by
Amir Aharon
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add network to docker-compose and start work
parent
15ae02bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
2 deletions
.vscode/c_cpp_properties.json
develop-compose.yml
src/impl/servers/Microservice_IRestServerEvppImpl.cpp
src/impl/servers/Microservice_IRestServerEvppImpl.h
.vscode/c_cpp_properties.json
View file @
8ef5aa9c
...
...
@@ -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"
:
[],
...
...
develop-compose.yml
View file @
8ef5aa9c
...
...
@@ -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
src/impl/servers/Microservice_IRestServerEvppImpl.cpp
0 → 100644
View file @
8ef5aa9c
#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
src/impl/servers/Microservice_IRestServerEvppImpl.h
0 → 100644
View file @
8ef5aa9c
#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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment