geostat/okapi.h

36 wiersze
1.0 KiB
C
Czysty Zwykły widok Historia

2019-09-08 16:42:10 +00:00
#pragma once
#include "api.h"
#include <string>
#include <map>
#include <utility>
2019-09-08 16:42:10 +00:00
2019-10-03 22:43:39 +00:00
class Okapi : public Api {
2019-09-08 16:42:10 +00:00
private:
std::string url;
std::string key;
std::string service;
2019-09-08 16:42:10 +00:00
static size_t write_cb(char* ptr, size_t size, size_t nmemb, void* userdata);
std::string curl_post(const std::string& url, const std::string& post) const;
std::string get_user_caches_json(const std::string& uuid, int count = 0, int offset = 0) const;
// std::string get_cache_json(std::string code) const;
std::string get_caches_json(const std::string& codes) const;
2019-09-08 16:42:10 +00:00
const static int MAX_LOGS = 1000;
const static int MAX_CACHES = 500;
2019-09-08 16:42:10 +00:00
public:
Okapi(const std::string& server_url, const std::string& consumer_key);
2019-09-08 16:42:10 +00:00
// Cache get_cache(std::string code);
Caches get_caches(const std::set<std::string>& codes) const;
2020-02-11 16:37:01 +00:00
Caches get_user_caches(const std::string& uuid, int count = 0) const override;
std::string get_changelog_json(int revision) const;
2019-09-08 16:42:10 +00:00
std::string get_uuid(const std::string& username) const;
std::string get_profile_url(const std::string& uuid) const;
2019-09-08 16:42:10 +00:00
};