Code

frontend: Added sdb_fe_parse_expr().
[sysdb.git] / src / frontend / connection-private.h
index 0126e892b1774f2071f255a0362ebb9404d77ef3..4ff4e51bb4ab44f9203ca12b49ab3f8501b64265 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "core/object.h"
 #include "core/store.h"
+#include "core/timeseries.h"
 #include "utils/strbuf.h"
 
 #include <inttypes.h>
@@ -72,6 +73,7 @@ struct sdb_conn {
 
        /* user information */
        char *username; /* NULL if the user has not been authenticated */
+       _Bool ready; /* indicates that startup finished successfully */
 };
 #define CONN(obj) ((sdb_conn_t *)(obj))
 
@@ -79,6 +81,12 @@ struct sdb_conn {
  * node types
  */
 
+typedef struct {
+       sdb_conn_node_t super;
+       sdb_store_expr_t *expr;
+} conn_expr_t;
+#define CONN_EXPR(obj) ((conn_expr_t *)(obj))
+
 typedef struct {
        sdb_conn_node_t super;
        sdb_store_matcher_t *matcher;
@@ -87,12 +95,14 @@ typedef struct {
 
 typedef struct {
        sdb_conn_node_t super;
+       int type;
        conn_matcher_t *filter;
 } conn_list_t;
 #define CONN_LIST(obj) ((conn_list_t *)(obj))
 
 typedef struct {
        sdb_conn_node_t super;
+       int type;
        char *name;
        conn_matcher_t *filter;
 } conn_fetch_t;
@@ -100,15 +110,30 @@ typedef struct {
 
 typedef struct {
        sdb_conn_node_t super;
+       int type;
        conn_matcher_t *matcher;
        conn_matcher_t *filter;
 } conn_lookup_t;
 #define CONN_LOOKUP(obj) ((conn_lookup_t *)(obj))
 
+typedef struct {
+       sdb_conn_node_t super;
+       char *hostname;
+       char *metric;
+       sdb_timeseries_opts_t opts;
+} conn_ts_t;
+#define CONN_TS(obj) ((conn_ts_t *)(obj))
+
 /*
  * type helper functions
  */
 
+static void __attribute__((unused))
+conn_expr_destroy(sdb_object_t *obj)
+{
+       sdb_object_deref(SDB_OBJ(CONN_EXPR(obj)->expr));
+} /* conn_expr_destroy */
+
 static void __attribute__((unused))
 conn_matcher_destroy(sdb_object_t *obj)
 {
@@ -136,6 +161,15 @@ conn_lookup_destroy(sdb_object_t *obj)
        sdb_object_deref(SDB_OBJ(CONN_LOOKUP(obj)->filter));
 } /* conn_lookup_destroy */
 
+static void __attribute__((unused))
+conn_ts_destroy(sdb_object_t *obj)
+{
+       if (CONN_TS(obj)->hostname)
+               free(CONN_TS(obj)->hostname);
+       if (CONN_TS(obj)->metric)
+               free(CONN_TS(obj)->metric);
+} /* conn_ts_destroy */
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif