Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
git-lfs-fetch.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/canon-path.hh
"
5
#include "
nix/util/serialise.hh
"
6
#include "
nix/util/url.hh
"
7
8
#include <git2/repository.h>
9
10
#include <nlohmann/json_fwd.hpp>
11
12
namespace
nix::lfs {
13
18
struct
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
25
struct
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
34
nix::ParsedURL
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
46
struct
LfsApiInfo
47
{
48
std::string endpoint;
49
std::optional<std::string> authHeader;
50
};
51
52
LfsApiInfo
getLfsApi(
ParsedURL
url);
53
54
}
// namespace nix::lfs
canon-path.hh
nix::CanonPath
Definition
canon-path.hh:50
serialise.hh
nix::ParsedURL
Definition
url.hh:22
nix::Sink
Definition
serialise.hh:18
nix::lfs::LfsApiInfo
Definition
git-lfs-fetch.hh:47
nix::lfs::Pointer
Definition
git-lfs-fetch.hh:19
url.hh
libfetchers
include
nix
fetchers
git-lfs-fetch.hh
Generated by
1.18.0