GNUnet  0.18.1
GNUNET_NAMESTORE_PluginFunctions Struct Reference

struct returned by the initialization function of the plugin More...

#include <gnunet_namestore_plugin.h>

Data Fields

void * cls
 Closure to pass to all plugin functions. More...
 
enum GNUNET_GenericReturnValue(* store_records )(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 Store a record in the datastore for which we are the authority. More...
 
enum GNUNET_GenericReturnValue(* lookup_records )(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Lookup records in the datastore for which we are the authority. More...
 
enum GNUNET_GenericReturnValue(* iterate_records )(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, uint64_t serial, uint64_t limit, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Iterate over the results for a particular zone in the datastore. More...
 
enum GNUNET_GenericReturnValue(* zone_to_name )(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const struct GNUNET_IDENTITY_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Look for an existing PKEY delegation record for a given public key. More...
 
enum GNUNET_GenericReturnValue(* transaction_begin )(void *cls, char **emsg)
 Transaction-based API draft. More...
 
enum GNUNET_GenericReturnValue(* transaction_rollback )(void *cls, char **emsg)
 Abort and roll back a transaction in the database. More...
 
enum GNUNET_GenericReturnValue(* transaction_commit )(void *cls, char **emsg)
 Commit a transaction in the database. More...
 
enum GNUNET_GenericReturnValue(* edit_records )(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Edit records in the datastore for which we are the authority. More...
 
enum GNUNET_GenericReturnValue(* create_tables )(void *cls)
 Setup the database. More...
 
enum GNUNET_GenericReturnValue(* drop_tables )(void *cls)
 Drop existing tables. More...
 

Detailed Description

struct returned by the initialization function of the plugin

Definition at line 74 of file gnunet_namestore_plugin.h.

Field Documentation

◆ cls

◆ store_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::store_records) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)

Store a record in the datastore for which we are the authority.

Removes any existing record in the same zone with the same name.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
labelname of the record in the zone
rd_countnumber of entries in rd array, 0 to delete all records
rdarray of records with data to store
Returns
GNUNET_OK on success, else GNUNET_SYSERR

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ lookup_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::lookup_records) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Lookup records in the datastore for which we are the authority.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
labelname of the record in the zone
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO for no results, else GNUNET_SYSERR

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by get_nick_record(), libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ iterate_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::iterate_records) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, uint64_t serial, uint64_t limit, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Iterate over the results for a particular zone in the datastore.

Will return at most limit results to the iterator.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone, NULL for all zones
serialserial (to exclude) in the list of matching records; 0 means to exclude nothing; results must be returned using the minimum possible sequence number first (ordered by serial)
limitmaximum number of results to return to iter
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO if there were no more results, GNUNET_SYSERR on error

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ zone_to_name

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::zone_to_name) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const struct GNUNET_IDENTITY_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Look for an existing PKEY delegation record for a given public key.

Returns at most one result to the iterator.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone to look up in, never NULL
value_zonepublic key of the target zone (value), never NULL
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ transaction_begin

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::transaction_begin) (void *cls, char **emsg)

Transaction-based API draft.

Start a transaction in the database

Parameters
clsclosure (internal context for the plugin)
emsgmessage. On error, string will be allocated and must be freed.
Returns
GNUNET_OK on success, GNUNET_SYSERR on error

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ transaction_rollback

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::transaction_rollback) (void *cls, char **emsg)

Abort and roll back a transaction in the database.

Parameters
clsclosure (internal context for the plugin)
emsgmessage. On error, string will be allocated and must be freed.
Returns
GNUNET_OK on success, GNUNET_SYSERR on error

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ transaction_commit

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::transaction_commit) (void *cls, char **emsg)

Commit a transaction in the database.

Parameters
clsclosure (internal context for the plugin)
emsgmessage. On error, string will be allocated and must be freed.
Returns
GNUNET_OK on success, GNUNET_SYSERR on error

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ edit_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::edit_records) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Edit records in the datastore for which we are the authority.

Should be called within a transaction (after begin) and maps to a SELECT ... FOR UPDATE in PQ.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
labelname of the record in the zone
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO for no results, else GNUNET_SYSERR

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ create_tables

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::create_tables) (void *cls)

Setup the database.

Parameters
clsclosure (internal context for the plugin)
Returns
GNUNET_OK on success, else fails with GNUNET_SYSERR

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ drop_tables

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::drop_tables) (void *cls)

Drop existing tables.

DANGEROUS: All existing data in the dabase will be lost!

Parameters
clsclosure (internal context for the plugin)
Returns
GNUNET_OK on success, else fails with GNUNET_SYSERR

Definition at line 79 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().


The documentation for this struct was generated from the following file: