X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Fcore%2Ftimeseries.h;fp=src%2Finclude%2Fcore%2Ftimeseries.h;h=3a50dc6c57d269ee05f3b285d09b5a3bb132267a;hp=ce4f0d24c974d89f8e7f6af8fa41ac4c5dac4821;hb=7df1cbe4d58dd82f9ea323647bedf18e62ddb965;hpb=562eaff4241f9b2428fdec9e26a10f41f681053d diff --git a/src/include/core/timeseries.h b/src/include/core/timeseries.h index ce4f0d2..3a50dc6 100644 --- a/src/include/core/timeseries.h +++ b/src/include/core/timeseries.h @@ -29,6 +29,7 @@ #define SDB_CORE_TIMESERIES_H 1 #include "sysdb.h" +#include "core/object.h" #include "core/time.h" #include "utils/strbuf.h" @@ -118,6 +119,27 @@ sdb_timeseries_create(size_t data_names_len, const char * const *data_names, void sdb_timeseries_destroy(sdb_timeseries_t *ts); +/* + * A timeseries fetcher fetches data from a timeseries data-store. + */ +typedef struct { + /* + * describe: + * Retrieve information about the timeseries from the data-store. The + * returned timeseries info object must be freeable using + * sdb_timeseries_info_destroy. + */ + sdb_timeseries_info_t *(*describe)(const char *id, sdb_object_t *user_data); + + /* + * fetch: + * Read timeseries data from the data-store. The returned timeseries + * object must be freeable using sdb_timeseries_destroy. + */ + sdb_timeseries_t *(*fetch)(const char *id, + sdb_timeseries_opts_t *opts, sdb_object_t *user_data); +} sdb_timeseries_fetcher_t; + /* * sdb_timeseries_tojson: * Serialize a time-series to JSON written to the specified string buffer.