exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

iterate_active_auditors.h (2649B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022 Taler Systems SA
      4 
      5    TALER is free software; you can redistribute it and/or modify it under the
      6    terms of the GNU General Public License as published by the Free Software
      7    Foundation; either version 3, or (at your option) any later version.
      8 
      9    TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11    A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13    You should have received a copy of the GNU General Public License along with
     14    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 /**
     17  * @file src/include/exchange-database/iterate_active_auditors.h
     18  * @brief implementation of the iterate_active_auditors function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H
     22 #define EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H
     23 
     24 #include "taler/taler_json_lib.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 /**
     29  * Function called with information about the exchange's auditors.
     30  *
     31  * @param cls closure with a `struct TEH_KeyStateHandle *`
     32  * @param auditor_pub the public key of the auditor
     33  * @param auditor_url URL of the REST API of the auditor
     34  * @param auditor_name human readable official name of the auditor
     35  */
     36 typedef void
     37 (*TALER_EXCHANGEDB_AuditorsCallback)(
     38   void *cls,
     39   const struct TALER_AuditorPublicKeyP *auditor_pub,
     40   const char *auditor_url,
     41   const char *auditor_name);
     42 
     43 
     44 /* Callback typedefs */
     45 /**
     46  * Function called with information about the exchange's auditors.
     47  *
     48  * @param cls closure with a `struct TEH_KeyStateHandle *`
     49  * @param auditor_pub the public key of the auditor
     50  * @param auditor_url URL of the REST API of the auditor
     51  * @param auditor_name human readable official name of the auditor
     52  */
     53 typedef void
     54 (*TALER_EXCHANGEDB_AuditorsCallback)(
     55   void *cls,
     56   const struct TALER_AuditorPublicKeyP *auditor_pub,
     57   const char *auditor_url,
     58   const char *auditor_name);
     59 
     60 /**
     61  * Function called to invoke @a cb on every active auditor. Disabled
     62  * auditors are skipped. Runs in its own read-only transaction.
     63  *
     64  * @param pg the database context
     65  * @param cb function to call on each active auditor
     66  * @param cb_cls closure for @a cb
     67  * @return transaction status code
     68  */
     69 enum GNUNET_DB_QueryStatus
     70 TALER_EXCHANGEDB_iterate_active_auditors (struct
     71                                           TALER_EXCHANGEDB_PostgresContext *pg,
     72                                           TALER_EXCHANGEDB_AuditorsCallback cb,
     73                                           void *cb_cls);
     74 
     75 #endif