mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/federation/version: Reorg into namespace; additional properties.
This commit is contained in:
parent
88808f597a
commit
7fd084c8ce
1 changed files with 25 additions and 15 deletions
|
@ -8,16 +8,21 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
using namespace ircd;
|
namespace ircd::m
|
||||||
|
{
|
||||||
|
static resource::response federation_version__get(client &, const resource::request &);
|
||||||
|
extern resource::method federation_version_get;
|
||||||
|
extern resource federation_version;
|
||||||
|
}
|
||||||
|
|
||||||
mapi::header
|
ircd::mapi::header
|
||||||
IRCD_MODULE
|
IRCD_MODULE
|
||||||
{
|
{
|
||||||
"Federation 2.2 :Version"
|
"Federation 2.2 :Version"
|
||||||
};
|
};
|
||||||
|
|
||||||
m::resource
|
decltype(ircd::m::federation_version)
|
||||||
version_resource
|
ircd::m::federation_version
|
||||||
{
|
{
|
||||||
"/_matrix/federation/v1/version",
|
"/_matrix/federation/v1/version",
|
||||||
{
|
{
|
||||||
|
@ -25,14 +30,25 @@ version_resource
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
m::resource::response
|
decltype(ircd::m::federation_version_get)
|
||||||
get__version(client &client,
|
ircd::m::federation_version_get
|
||||||
const m::resource::request &request)
|
{
|
||||||
|
federation_version, "GET", federation_version__get
|
||||||
|
};
|
||||||
|
|
||||||
|
ircd::m::resource::response
|
||||||
|
ircd::m::federation_version__get(client &client,
|
||||||
|
const resource::request &request)
|
||||||
{
|
{
|
||||||
const json::members server
|
const json::members server
|
||||||
{
|
{
|
||||||
{ "name", ircd::info::name },
|
{ "name", ircd::info::name },
|
||||||
{ "version", ircd::info::version },
|
{ "version", ircd::info::version },
|
||||||
|
{ "branch", ircd::info::branch },
|
||||||
|
{ "commit", ircd::info::commit },
|
||||||
|
{ "compiler", ircd::info::compiler },
|
||||||
|
{ "kernel", ircd::info::kernel_name },
|
||||||
|
{ "arch", ircd::info::hardware::arch },
|
||||||
};
|
};
|
||||||
|
|
||||||
return m::resource::response
|
return m::resource::response
|
||||||
|
@ -43,9 +59,3 @@ get__version(client &client,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
m::resource::method
|
|
||||||
method_get
|
|
||||||
{
|
|
||||||
version_resource, "GET", get__version
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in a new issue