#include <UIClient.hpp>
Classes | |
| class | Impl |
Public Member Functions | |
| UIClient (std::string socket_uri) | |
| ~UIClient () | |
| UIClient (const UIClient &)=delete | |
| UIClient & | operator= (const UIClient &)=delete |
| void | start () |
| void | stop () |
| bool | is_connected () const noexcept |
| std::optional< bsc::rule::Rule > | ask_rule (const bsc::model::Connection &conn) |
| bool | ping (const bsc::stats::Statistics &stats) |
| bool | post_alert (const std::string &text) |
| bool | post_connection_alert (const bsc::model::Connection &conn, const std::string &action, const std::string &rule_name={}) |
| void | set_notification_handler (std::function< void(const NotificationEvent &)> cb) |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Client Unix-socket verso il server della UI. Sostituisce la precedente implementazione gRPC. Gestisce:
Definition at line 35 of file UIClient.hpp.
|
explicit |
Definition at line 372 of file UIClient.cpp.
References impl_.
Referenced by operator=(), and UIClient().
|
default |
|
delete |
References UIClient().
| std::optional< bsc::rule::Rule > bsc::ui::UIClient::ask_rule | ( | const bsc::model::Connection & | conn | ) |
Definition at line 389 of file UIClient.cpp.
References impl_, and bsc::proto::msg::kAskRule.
Referenced by operator=().
|
noexcept |
References ask_rule(), is_connected(), ping(), post_alert(), post_connection_alert(), start(), stop(), and UIClient().
| bool bsc::ui::UIClient::ping | ( | const bsc::stats::Statistics & | stats | ) |
Definition at line 436 of file UIClient.cpp.
References impl_, and bsc::proto::msg::kPing.
Referenced by operator=().
| bool bsc::ui::UIClient::post_alert | ( | const std::string & | text | ) |
Definition at line 456 of file UIClient.cpp.
References impl_, and bsc::proto::msg::kAlert.
Referenced by operator=(), and bsc::service::DaemonService::run().
| bool bsc::ui::UIClient::post_connection_alert | ( | const bsc::model::Connection & | conn, |
| const std::string & | action, | ||
| const std::string & | rule_name = {} ) |
Definition at line 467 of file UIClient.cpp.
References impl_, and bsc::proto::msg::kAlert.
Referenced by operator=().
| void bsc::ui::UIClient::set_notification_handler | ( | std::function< void(const NotificationEvent &)> | cb | ) |
Definition at line 384 of file UIClient.cpp.
References impl_.
Referenced by bsc::service::DaemonService::run().
| void bsc::ui::UIClient::start | ( | ) |
Definition at line 377 of file UIClient.cpp.
References impl_.
Referenced by operator=(), and bsc::service::DaemonService::run().
| void bsc::ui::UIClient::stop | ( | ) |
Definition at line 378 of file UIClient.cpp.
References impl_.
Referenced by operator=().
|
private |
Definition at line 58 of file UIClient.hpp.
Referenced by ask_rule(), is_connected(), ping(), post_alert(), post_connection_alert(), set_notification_handler(), start(), stop(), and UIClient().