mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-05 19:06:44 +00:00
new(userspace/falco): gRPC unary version service impl
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
550ee0d8fc
commit
714a6619ad
@ -62,5 +62,6 @@ public:
|
|||||||
mutable void* m_stream = nullptr; // todo(fntlnz, leodido) > useful in the future
|
mutable void* m_stream = nullptr; // todo(fntlnz, leodido) > useful in the future
|
||||||
mutable bool m_has_more = false;
|
mutable bool m_has_more = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace grpc
|
} // namespace grpc
|
||||||
} // namespace falco
|
} // namespace falco
|
||||||
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config_falco.h"
|
||||||
#include "grpc_server_impl.h"
|
#include "grpc_server_impl.h"
|
||||||
#include "falco_output_queue.h"
|
#include "falco_output_queue.h"
|
||||||
#include "banned.h"
|
#include "banned.h"
|
||||||
@ -49,6 +50,16 @@ void falco::grpc::server_impl::subscribe(const stream_context& ctx, const output
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void falco::grpc::server_impl::version(const context& ctx, const version::request&, version::response& res)
|
||||||
|
{
|
||||||
|
res.set_version(FALCO_VERSION);
|
||||||
|
res.set_major(std::stoi(FALCO_VERSION_MAJOR));
|
||||||
|
res.set_minor(std::stoi(FALCO_VERSION_MINOR));
|
||||||
|
res.set_patch(std::stoi(FALCO_VERSION_PATCH));
|
||||||
|
res.set_prerelease(FALCO_VERSION_PRERELEASE);
|
||||||
|
res.set_build(FALCO_VERSION_BUILD);
|
||||||
|
}
|
||||||
|
|
||||||
void falco::grpc::server_impl::shutdown()
|
void falco::grpc::server_impl::shutdown()
|
||||||
{
|
{
|
||||||
m_stop = true;
|
m_stop = true;
|
||||||
|
@ -18,6 +18,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include "output.grpc.pb.h"
|
#include "output.grpc.pb.h"
|
||||||
|
#include "version.grpc.pb.h"
|
||||||
#include "grpc_context.h"
|
#include "grpc_context.h"
|
||||||
|
|
||||||
namespace falco
|
namespace falco
|
||||||
@ -37,6 +38,8 @@ protected:
|
|||||||
|
|
||||||
void subscribe(const stream_context& ctx, const output::request& req, output::response& res);
|
void subscribe(const stream_context& ctx, const output::request& req, output::response& res);
|
||||||
|
|
||||||
|
void version(const context& ctx, const version::request& req, version::response& res);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic<bool> m_stop{false};
|
std::atomic<bool> m_stop{false};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user