get_fountain.h (2064B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2026 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/merchant-database/get_fountain.h 18 * @brief implementation of the get_fountain function for Postgres 19 * @author Bohdan Potuzhnyi 20 */ 21 #ifndef MERCHANT_DATABASE_GET_FOUNTAIN_H 22 #define MERCHANT_DATABASE_GET_FOUNTAIN_H 23 24 #include <taler/taler_util.h> 25 #include "merchantdb_lib.h" 26 27 28 struct TALER_MERCHANTDB_PostgresContext; 29 30 /** 31 * Details about a fountain (DD 98), excluding its grants and 32 * (the hash of) its bearer credential. 33 */ 34 struct TALER_MERCHANTDB_FountainDetails 35 { 36 /** 37 * Serial of the fountain in the database. 38 */ 39 uint64_t fountain_serial; 40 41 /** 42 * Description of the fountain. Malloc'ed, caller must free. 43 */ 44 char *description; 45 46 /** 47 * How often wallets should re-poll the fountain info. 48 */ 49 struct GNUNET_TIME_Relative poll_freq; 50 }; 51 52 53 /** 54 * Look up details of a fountain by its public identifier. 55 * 56 * @param pg database context 57 * @param instance_id instance the fountain belongs to 58 * @param fountain_id public identifier of the fountain 59 * @param[out] fd set to the fountain details on success, 60 * `fd->description` must be freed by the caller 61 * @return database result code 62 */ 63 enum GNUNET_DB_QueryStatus 64 TALER_MERCHANTDB_get_fountain ( 65 struct TALER_MERCHANTDB_PostgresContext *pg, 66 const char *instance_id, 67 const char *fountain_id, 68 struct TALER_MERCHANTDB_FountainDetails *fd); 69 70 #endif