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 (2980B)


      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 #ifndef TALER_EXCHANGEDB_AUDITORS_RESULT_CLOSURE
     37 /**
     38  * Type of the closure for #TALER_EXCHANGEDB_AuditorsCallback.
     39  */
     40 #define TALER_EXCHANGEDB_AUDITORS_RESULT_CLOSURE void
     41 #endif
     42 typedef void
     43 (*TALER_EXCHANGEDB_AuditorsCallback)(
     44   TALER_EXCHANGEDB_AUDITORS_RESULT_CLOSURE *cls,
     45   const struct TALER_AuditorPublicKeyP *auditor_pub,
     46   const char *auditor_url,
     47   const char *auditor_name);
     48 
     49 
     50 /* Callback typedefs */
     51 /**
     52  * Function called with information about the exchange's auditors.
     53  *
     54  * @param cls closure with a `struct TEH_KeyStateHandle *`
     55  * @param auditor_pub the public key of the auditor
     56  * @param auditor_url URL of the REST API of the auditor
     57  * @param auditor_name human readable official name of the auditor
     58  */
     59 typedef void
     60 (*TALER_EXCHANGEDB_AuditorsCallback)(
     61   TALER_EXCHANGEDB_AUDITORS_RESULT_CLOSURE *cls,
     62   const struct TALER_AuditorPublicKeyP *auditor_pub,
     63   const char *auditor_url,
     64   const char *auditor_name);
     65 
     66 /**
     67  * Function called to invoke @a cb on every active auditor. Disabled
     68  * auditors are skipped. Runs in its own read-only transaction.
     69  *
     70  * @param pg the database context
     71  * @param cb function to call on each active auditor
     72  * @param cb_cls closure for @a cb
     73  * @return transaction status code
     74  */
     75 enum GNUNET_DB_QueryStatus
     76 TALER_EXCHANGEDB_iterate_active_auditors (struct
     77                                           TALER_EXCHANGEDB_PostgresContext *pg,
     78                                           TALER_EXCHANGEDB_AuditorsCallback cb,
     79                                           TALER_EXCHANGEDB_AUDITORS_RESULT_CLOSURE
     80                                           *cb_cls);
     81 
     82 #endif