Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
git-lfs-fetch.hh
Go to the documentation of this file.
1#pragma once
3
6#include "nix/util/url.hh"
7
8#include <git2/repository.h>
9
10#include <nlohmann/json_fwd.hpp>
11
12namespace nix::lfs {
13
18struct Pointer
19{
20 std::string oid; // git-lfs managed object id. you give this to the lfs server
21 // for downloads
22 size_t size; // in bytes
23};
24
25struct Fetch
26{
27 // Reference to the repository
28 const git_repository * repo;
29
30 // Git commit being fetched
31 git_oid rev;
32
33 // derived from git remote url
35
36 Fetch(git_repository * repo, git_oid rev);
37 bool shouldFetch(const CanonPath & path) const;
38 void fetch(
39 const std::string & content,
40 const CanonPath & pointerFilePath,
41 Sink & sink,
42 std::function<void(uint64_t)> sizeCallback) const;
43 std::vector<nlohmann::json> fetchUrls(const std::vector<Pointer> & pointers) const;
44};
45
47{
48 std::string endpoint;
49 std::optional<std::string> authHeader;
50};
51
52LfsApiInfo getLfsApi(ParsedURL url);
53
54} // namespace nix::lfs
Definition canon-path.hh:50
Definition url.hh:22
Definition serialise.hh:18
Definition git-lfs-fetch.hh:47
Definition git-lfs-fetch.hh:19