Introduce HTTP API for plugins (#5383)
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
|
||||
# include "Application.hpp"
|
||||
# include "common/Args.hpp"
|
||||
# include "common/network/NetworkCommon.hpp"
|
||||
# include "common/QLogging.hpp"
|
||||
# include "controllers/commands/CommandContext.hpp"
|
||||
# include "controllers/commands/CommandController.hpp"
|
||||
# include "controllers/plugins/api/ChannelRef.hpp"
|
||||
# include "controllers/plugins/api/HTTPRequest.hpp"
|
||||
# include "controllers/plugins/api/HTTPResponse.hpp"
|
||||
# include "controllers/plugins/api/IOWrapper.hpp"
|
||||
# include "controllers/plugins/LuaAPI.hpp"
|
||||
# include "controllers/plugins/LuaUtilities.hpp"
|
||||
@@ -174,10 +177,19 @@ void PluginController::openLibrariesFor(lua_State *L, const PluginMeta &meta,
|
||||
lua::pushEnumTable<Channel::Type>(L);
|
||||
lua_setfield(L, c2libIdx, "ChannelType");
|
||||
|
||||
lua::pushEnumTable<NetworkRequestType>(L);
|
||||
lua_setfield(L, c2libIdx, "HTTPMethod");
|
||||
|
||||
// Initialize metatables for objects
|
||||
lua::api::ChannelRef::createMetatable(L);
|
||||
lua_setfield(L, c2libIdx, "Channel");
|
||||
|
||||
lua::api::HTTPRequest::createMetatable(L);
|
||||
lua_setfield(L, c2libIdx, "HTTPRequest");
|
||||
|
||||
lua::api::HTTPResponse::createMetatable(L);
|
||||
lua_setfield(L, c2libIdx, "HTTPResponse");
|
||||
|
||||
lua_setfield(L, gtable, "c2");
|
||||
|
||||
// ban functions
|
||||
|
||||
Reference in New Issue
Block a user