paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

paivana-httpd_templates.h (1886B)


      1 /*
      2      This file is part of GNUnet.
      3      Copyright (C) 2026 Taler Systems SA
      4 
      5      Paivana is free software; you can redistribute it and/or
      6      modify it under the terms of the GNU General Public License
      7      as published by the Free Software Foundation; either version
      8      3, or (at your option) any later version.
      9 
     10      Paivana is distributed in the hope that it will be useful,
     11      but WITHOUT ANY WARRANTY; without even the implied warranty
     12      of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     13      the GNU General Public License for more details.
     14 
     15      You should have received a copy of the GNU General Public
     16      License along with Paivana; see the file COPYING.  If not,
     17      write to the Free Software Foundation, Inc., 51 Franklin
     18      Street, Fifth Floor, Boston, MA 02110-1301, USA.
     19 */
     20 
     21 /**
     22  * @author Christian Grothoff
     23  * @file paivana-httpd_templates.h
     24  * @brief functions to work with merchant backend templates
     25  */
     26 #ifndef PAIVANA_HTTPD_TEMPLATES_H
     27 #define PAIVANA_HTTPD_TEMPLATES_H
     28 
     29 #include <microhttpd.h>
     30 #include <gnunet/gnunet_util_lib.h>
     31 
     32 
     33 /**
     34  * Load the templates from the merchant backend.  Calls
     35  * PAIVANA_HTTPD_serve_requests() upon completion if successful,
     36  * otherwise may initiate shutdown.
     37  */
     38 void
     39 PAIVANA_HTTPD_load_templates (void);
     40 
     41 
     42 /**
     43  * Return the paywall page for the given @a website.
     44  *
     45  * @param connection request to search paywall response for
     46  * @param website site to look for paywall templates for
     47  * @return #GNUNET_OK on paywall returned,
     48  *         #GNUNET_NO to close the connection with error
     49  *         #GNUNET_SYSERR if there is no paywall for @a website
     50  */
     51 enum GNUNET_GenericReturnValue
     52 PAIVANA_HTTPD_search_templates (struct MHD_Connection *connection,
     53                                 const char *website);
     54 
     55 
     56 /**
     57  * Unload all of the template state.
     58  */
     59 void
     60 PAIVANA_HTTPD_unload_templates (void);
     61 
     62 #endif