GNUnet 0.22.2
GNUNET_NAMECACHE_PluginFunctions Struct Reference

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

#include <gnunet_namecache_plugin.h>

Data Fields

void * cls
 Closure to pass to all plugin functions. More...
 
int(* cache_block )(void *cls, const struct GNUNET_GNSRECORD_Block *block)
 Cache a block in the datastore. More...
 
int(* lookup_block )(void *cls, const struct GNUNET_HashCode *query, GNUNET_NAMECACHE_BlockCallback iter, void *iter_cls)
 Get the block for a particular zone and label in the datastore. More...
 

Detailed Description

struct returned by the initialization function of the plugin

Definition at line 68 of file gnunet_namecache_plugin.h.

Field Documentation

◆ cls

◆ cache_block

int(* GNUNET_NAMECACHE_PluginFunctions::cache_block) (void *cls, const struct GNUNET_GNSRECORD_Block *block)

Cache a block in the datastore.

Overwrites existing blocks for the same zone and label.

Parameters
clsclosure (internal context for the plugin)
blockblock to cache
Returns
GNUNET_OK on success, else GNUNET_SYSERR

Definition at line 83 of file gnunet_namecache_plugin.h.

Referenced by handle_block_cache(), libgnunet_plugin_namecache_flat_init(), libgnunet_plugin_namecache_postgres_init(), and libgnunet_plugin_namecache_sqlite_init().

◆ lookup_block

int(* GNUNET_NAMECACHE_PluginFunctions::lookup_block) (void *cls, const struct GNUNET_HashCode *query, GNUNET_NAMECACHE_BlockCallback iter, void *iter_cls)

Get the block for a particular zone and label in the datastore.

Will return at most one result to the iterator.

Parameters
clsclosure (internal context for the plugin)
queryhash of public key derived from the zone and the label
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 97 of file gnunet_namecache_plugin.h.

Referenced by handle_lookup_block(), libgnunet_plugin_namecache_flat_init(), libgnunet_plugin_namecache_postgres_init(), and libgnunet_plugin_namecache_sqlite_init().


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