httprpc.h raw
1 // Copyright (c) 2015-2021 The Limenka developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5 #ifndef LIMENKA_HTTPRPC_H
6 #define LIMENKA_HTTPRPC_H
7
8 #include <any>
9 #include <set>
10 #include <string>
11
12 /** Start HTTP RPC subsystem.
13 * Precondition; HTTP and RPC has been started.
14 */
15 bool StartHTTPRPC(const std::any& context);
16 /** Interrupt HTTP RPC subsystem.
17 */
18 void InterruptHTTPRPC();
19 /** Stop HTTP RPC subsystem.
20 * Precondition; HTTP and RPC has been stopped.
21 */
22 void StopHTTPRPC();
23
24 /** Start HTTP REST subsystem.
25 * Precondition; HTTP and RPC has been started.
26 */
27 void StartREST(const std::any& context);
28 /** Interrupt RPC REST subsystem.
29 */
30 void InterruptREST();
31 /** Stop HTTP REST subsystem.
32 * Precondition; HTTP and RPC has been stopped.
33 */
34 void StopREST();
35
36 /** Returns a collection of whitelisted RPCs for the given user
37 */
38 std::set<std::string> GetWhitelistedRpcs(const std::string& user_name);
39
40 #endif // LIMENKA_HTTPRPC_H
41