Web: publish module descriptor

This commit is contained in:
faumaray committed 2026-07-28 23:32:34 +03:00
1 parent be961cd73d
commit a727f9c6cd
3 files changed
+84

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
#include <echoion/api/module/Module.hpp>
#include <memory>
#include <string_view>
namespace Echoion::Web
{
namespace
{
class WebModule final : public Void::Plugin::IModule
{
public:
[[nodiscard]] std::string_view name() const noexcept override
{
return "EchoionWeb";
}
};
std::unique_ptr<Void::Plugin::IModule> createWebModule()
{
return std::make_unique<WebModule>();
}
} // namespace
const Void::Plugin::ModuleDescriptor& webModuleDescriptor()
{
static const Void::Plugin::ModuleDescriptor descriptor{
.module_id = "EchoionWeb",
.component_version = {
.major = ECHOION_COMPONENT_VERSION_MAJOR,
.minor = ECHOION_COMPONENT_VERSION_MINOR,
.patch = ECHOION_COMPONENT_VERSION_PATCH,
.pre_release = {},
.build = {},
},
.abi_hash =
"sha256:858dfd3a19804e42a63fa8694a70ebe07ee90485a886df1ac07cf91bb5d34316",
.abi_contract = Void::Json::object({
{"schemaVersion", 1},
{"contractId", "echoion.module.web"},
{"descriptor", "Void::Plugin::ModuleDescriptor"},
}),
.dependencies = {
{
.module_id = "EchoionApi",
.version_range = "^2.0.0",
.abi_hash = "sha256:336492a52097dd12f222bb6d9acab19e8eb6a502eab45bb78127bce6d733fbd3",
},
},
.activation_policy =
Void::Plugin::ActivationPolicy::RestartRequired,
.create = createWebModule,
};
return descriptor;
}
} // namespace Echoion::Web
extern "C" ECHOION_MODULE_EXPORT const Void::Plugin::ModuleDescriptor*
echoion_module_query()
{
return &Echoion::Web::webModuleDescriptor();
}