storage_engine.h 860 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_STORAGEENGINEAPI_H
  3. #define NETDATA_STORAGEENGINEAPI_H
  4. #include "rrd.h"
  5. typedef struct storage_engine STORAGE_ENGINE;
  6. // ------------------------------------------------------------------------
  7. // function pointers for all APIs provided by a storge engine
  8. typedef struct storage_engine_api {
  9. struct rrddim_collect_ops collect_ops;
  10. struct rrddim_query_ops query_ops;
  11. } STORAGE_ENGINE_API;
  12. struct storage_engine {
  13. RRD_MEMORY_MODE id;
  14. const char* name;
  15. STORAGE_ENGINE_API api;
  16. };
  17. extern STORAGE_ENGINE* storage_engine_get(RRD_MEMORY_MODE mmode);
  18. extern STORAGE_ENGINE* storage_engine_find(const char* name);
  19. // Iterator over existing engines
  20. extern STORAGE_ENGINE* storage_engine_foreach_init();
  21. extern STORAGE_ENGINE* storage_engine_foreach_next(STORAGE_ENGINE* it);
  22. #endif