1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the "php-ipfs" package. |
7
|
|
|
* |
8
|
|
|
* (c) Robert Schönthal <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace IPFS\Api; |
15
|
|
|
|
16
|
|
|
use IPFS\Annotation\Api as Endpoint; |
17
|
|
|
use IPFS\Command\Command; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @author Robert Schönthal <[email protected]> |
21
|
|
|
* @autogenerated |
22
|
|
|
* @codeCoverageIgnore |
23
|
|
|
*/ |
24
|
|
|
final class Repo implements Api |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Remove repo lockfiles. |
28
|
|
|
* |
29
|
|
|
* @Endpoint(name="repo:fsck") |
30
|
|
|
* |
31
|
|
|
* @return Command |
32
|
|
|
*/ |
33
|
|
|
public function fsck(): Command |
34
|
|
|
{ |
35
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Perform a garbage collection sweep on the repo. |
40
|
|
|
* |
41
|
|
|
* @Endpoint(name="repo:gc") |
42
|
|
|
* |
43
|
|
|
* @param bool $streamErrors stream errors |
44
|
|
|
* @param bool $quiet write minimal output |
45
|
|
|
* |
46
|
|
|
* @return Command |
47
|
|
|
*/ |
48
|
|
|
public function gc(bool $streamErrors = false, bool $quiet = false): Command |
49
|
|
|
{ |
50
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Get stats for the currently used repo. |
55
|
|
|
* |
56
|
|
|
* @Endpoint(name="repo:stat") |
57
|
|
|
* |
58
|
|
|
* @param bool $human output RepoSize in MiB |
59
|
|
|
* |
60
|
|
|
* @return Command |
61
|
|
|
*/ |
62
|
|
|
public function stat(bool $human = false): Command |
63
|
|
|
{ |
64
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Verify all blocks in repo are not corrupted. |
69
|
|
|
* |
70
|
|
|
* @Endpoint(name="repo:verify") |
71
|
|
|
* |
72
|
|
|
* @return Command |
73
|
|
|
*/ |
74
|
|
|
public function verify(): Command |
75
|
|
|
{ |
76
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Show the repo version. |
81
|
|
|
* |
82
|
|
|
* @Endpoint(name="repo:version") |
83
|
|
|
* |
84
|
|
|
* @param bool $quiet write minimal output |
85
|
|
|
* |
86
|
|
|
* @return Command |
87
|
|
|
*/ |
88
|
|
|
public function version(bool $quiet = false): Command |
89
|
|
|
{ |
90
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|