mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-06 04:51:46 -07:00
HTTP backend support for JSONDB
This commit is contained in:
parent
f6d92eb737
commit
bc61357a44
5 changed files with 178 additions and 60 deletions
|
@ -31,22 +31,21 @@
|
|||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/InetAddress.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "../ext/json/json.hpp"
|
||||
#include "../osdep/OSUtils.hpp"
|
||||
#include "../osdep/Http.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* Hierarchical JSON store that persists into the filesystem
|
||||
* Hierarchical JSON store that persists into the filesystem or via HTTP
|
||||
*/
|
||||
class JSONDB
|
||||
{
|
||||
public:
|
||||
JSONDB(const std::string &basePath) :
|
||||
_basePath(basePath)
|
||||
{
|
||||
_reload(_basePath,std::string());
|
||||
}
|
||||
JSONDB(const std::string &basePath);
|
||||
|
||||
inline void reload()
|
||||
{
|
||||
|
@ -106,6 +105,7 @@ private:
|
|||
inline bool operator!=(const _E &e) const { return (obj != e.obj); }
|
||||
};
|
||||
|
||||
InetAddress _httpAddr;
|
||||
std::string _basePath;
|
||||
std::map<std::string,_E> _db;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue