2017-05-20 02:57:51 +00:00
|
|
|
#ifndef BOLTDB_H
|
|
|
|
#define BOLTDB_H
|
|
|
|
|
|
|
|
#include "interop.h"
|
2017-05-20 03:47:18 +00:00
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
typedef std::function<void(QByteArray)> NameReciever;
|
2017-05-20 02:57:51 +00:00
|
|
|
|
|
|
|
class BoltDB
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
BoltDB();
|
|
|
|
|
|
|
|
GoInt64 gmsDbRef;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static BoltDB* createFrom(QString filePath, QString &errorOut);
|
|
|
|
|
2017-05-20 03:47:18 +00:00
|
|
|
bool listBucketsAtRoot(QString& errorOut, NameReciever cb);
|
|
|
|
|
2017-05-21 01:31:28 +00:00
|
|
|
bool listBuckets(QStringList bucketPath, QString& errorOut, NameReciever cb);
|
|
|
|
|
2017-05-21 04:15:49 +00:00
|
|
|
bool listKeys(QStringList bucketPath, QString& errorOut, std::function<void(QByteArray, int64_t)> cb);
|
|
|
|
|
2017-05-21 03:49:47 +00:00
|
|
|
bool getStatsJSON(std::function<void(QByteArray)> onSuccess, std::function<void(QString)> onError);
|
2017-05-20 23:59:38 +00:00
|
|
|
|
2017-05-21 03:49:47 +00:00
|
|
|
bool getBucketStatsJSON(QStringList bucketPath, std::function<void(QByteArray)> onSuccess, std::function<void(QString)> onError);
|
2017-05-21 00:39:55 +00:00
|
|
|
|
2017-05-20 02:57:51 +00:00
|
|
|
~BoltDB();
|
2017-05-21 01:31:28 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
bool pumpNext(GoInt64 jobRef, QString& errorOut, NameReciever cb);
|
2017-05-20 02:57:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BOLTDB_H
|