0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

ircd:Ⓜ️ Add a txn structure.

This commit is contained in:
Jason Volk 2017-10-15 21:57:29 -07:00
parent 5797e99d81
commit 761cd1913e
2 changed files with 59 additions and 0 deletions

View file

@ -33,6 +33,7 @@
#include "m/room.h"
#include "m/user.h"
#include "m/filter.h"
#include "m/txn.h"
#include "m/request.h"
#include "m/session.h"

58
include/ircd/m/txn.h Normal file
View file

@ -0,0 +1,58 @@
/*
* charybdis: 21st Century IRC++d
*
* Copyright (C) 2016 Charybdis Development Team
* Copyright (C) 2016 Jason Volk <jason@zemos.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice is present in all copies.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#pragma once
#define HAVE_IRCD_M_TXN_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsubobject-linkage"
namespace ircd::m
{
struct txn;
}
namespace ircd::m::name
{
constexpr const char *const edus {"edus"};
// constexpr const char *const origin {"origin"};
// constexpr const char *const origin_server_ts {"origin_server_ts"};
constexpr const char *const pdu_failures {"pdu_failures"};
constexpr const char *const pdus {"pdus"};
}
struct ircd::m::txn
:json::tuple
<
json::property<name::edus, string_view>,
json::property<name::origin, string_view>,
json::property<name::origin_server_ts, time_t>,
json::property<name::pdu_failures, string_view>,
json::property<name::pdus, string_view>
>
{
using super_type::tuple;
using super_type::operator=;
};
#pragma GCC diagnostic pop