19#ifndef DETERMINISTICESPASYNCWEBSERVER_DOCSTORE_H
20#define DETERMINISTICESPASYNCWEBSERVER_DOCSTORE_H
24#if DETWS_ENABLE_DOCSTORE
37void detws_docstore_open(DetwsDocStore *ds, DetwsDbm *db);
43bool detws_docstore_put(DetwsDocStore *ds,
const char *
id, uint16_t id_len,
const uint8_t *json, uint32_t json_len);
49long detws_docstore_get(DetwsDocStore *ds,
const char *
id, uint16_t id_len, uint8_t *buf,
size_t cap);
52bool detws_docstore_del(DetwsDocStore *ds,
const char *
id, uint16_t id_len);
55bool detws_docstore_contains(DetwsDocStore *ds,
const char *
id, uint16_t id_len);
58uint32_t detws_docstore_count(DetwsDocStore *ds);
61bool detws_docstore_sync(DetwsDocStore *ds);
67using DetwsDocMatchCb = bool (*)(
const char *id, uint16_t id_len,
const uint8_t *json, uint32_t json_len,
void *ctx);
73uint32_t detws_docstore_find_str(DetwsDocStore *ds,
const char *field,
const char *value, DetwsDocMatchCb cb,
77uint32_t detws_docstore_find_int(DetwsDocStore *ds,
const char *field,
long value, DetwsDocMatchCb cb,
void *ctx);
80uint32_t detws_docstore_find_bool(DetwsDocStore *ds,
const char *field,
bool value, DetwsDocMatchCb cb,
void *ctx);
User-facing configuration for DeterministicESPAsyncWebServer.
Log-structured hash key-value store on the WAL (DETWS_ENABLE_DBM, requires DETWS_ENABLE_WAL).