Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
ostree_http_repo.h
1 #ifndef SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_
2 #define SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_
3 
4 #include <boost/filesystem.hpp>
5 
6 #include "ostree_ref.h"
7 #include "ostree_repo.h"
8 #include "treehub_server.h"
9 
10 class OSTreeHttpRepo : public OSTreeRepo {
11  public:
12  explicit OSTreeHttpRepo(TreehubServer* server) : server_(server) {}
13  ~OSTreeHttpRepo() override = default;
14 
15  bool LooksValid() const override;
16  OSTreeRef GetRef(const std::string& refname) const override;
17  const boost::filesystem::path root() const override { return root_.Path(); }
18 
19  private:
20  bool FetchObject(const boost::filesystem::path& path) const override;
21  static size_t curl_handle_write(void* buffer, size_t size, size_t nmemb, void* userp);
22 
23  TreehubServer* server_;
24  const TemporaryDirectory root_;
25 };
26 
27 // vim: set tabstop=2 shiftwidth=2 expandtab:
28 #endif // SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_
TreehubServer
Definition: treehub_server.h:11
TemporaryDirectory
Definition: utils.h:82
OSTreeRepo
A source repository to read OSTree objects from.
Definition: ostree_repo.h:19
OSTreeHttpRepo
Definition: ostree_http_repo.h:10
OSTreeRef
Definition: ostree_ref.h:13