Gtuber Cache

Gtuber Cache — a cache for storing some values locally

Functions

Description

Functions

gtuber_cache_plugin_read ()

gchar *
gtuber_cache_plugin_read (const gchar *plugin_name,
                          const gchar *key);

Reads the value of a given plugin name with key.

This is mainly useful for plugin development.

Parameters

plugin_name

short and unique name of plugin.

 

key

name of the key this value is associated with.

 

Returns

cached value or NULL if unavailable or expired.

[transfer full]


gtuber_cache_plugin_write ()

void
gtuber_cache_plugin_write (const gchar *plugin_name,
                           const gchar *key,
                           const gchar *val,
                           gint64 exp);

Writes the value of a given plugin name with key. This function uses time in seconds to set how long cached value will stay valid.

This is mainly useful for plugin development.

Parameters

plugin_name

short and unique name of plugin.

 

key

name of the key this value is associated with.

 

val

value to store in cache file.

[nullable]

exp

expire time in seconds from now.

 

gtuber_cache_plugin_write_epoch ()

void
gtuber_cache_plugin_write_epoch (const gchar *plugin_name,
                                 const gchar *key,
                                 const gchar *val,
                                 gint64 epoch);

Writes the value of a given plugin name with key. This function uses epoch time to set date when cached value will expire.

This is mainly useful for plugin development.

Parameters

plugin_name

short and unique name of plugin.

 

key

name of the key this value is associated with.

 

val

value to store in cache file.

[nullable]

epoch

expire date in epoch time.