2020-08-13 09:26:06 +00:00
|
|
|
#ifndef CORE_CACHE_H
|
|
|
|
#define CORE_CACHE_H
|
|
|
|
|
|
|
|
#include <sqlite3.h>
|
|
|
|
|
2020-08-13 14:29:26 +00:00
|
|
|
#include <models/schedule.h>
|
|
|
|
#include <models/relay.h>
|
|
|
|
#include <models/controller.h>
|
|
|
|
|
2020-08-13 09:26:06 +00:00
|
|
|
extern sqlite3 *cache_database;
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_init();
|
|
|
|
|
2020-08-13 14:29:26 +00:00
|
|
|
void
|
|
|
|
cache_free();
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_put_json_schedule(int schedule_id, char *schedule_json);
|
|
|
|
|
|
|
|
char*
|
|
|
|
cache_get_json_schedule(int schedule_id);
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_invalidate_schedule(int schedule_id);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2020-08-25 10:39:43 +00:00
|
|
|
cache_put_json_relay(int relay_id, int status_relay, char *relay_json);
|
2020-08-13 14:29:26 +00:00
|
|
|
|
|
|
|
char*
|
2020-08-25 10:39:43 +00:00
|
|
|
cache_get_json_relay(int relay_id, int status_relay);
|
2020-08-13 14:29:26 +00:00
|
|
|
|
|
|
|
void
|
2020-08-25 10:39:43 +00:00
|
|
|
cache_invalidate_relay(int relay_id, int status_relay);
|
2020-08-13 14:29:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_put_json_controller(int controller_id, char *controller_json);
|
|
|
|
|
|
|
|
char*
|
|
|
|
cache_get_json_controller(int controller_id);
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_invalidate_controller(int controller_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_invalidate_tagged(int tag_id);
|
|
|
|
|
2020-08-13 09:26:06 +00:00
|
|
|
#endif /* CORE_CACHE_H */
|