1 | <?php |
||
24 | final class Cobject implements Api |
||
25 | { |
||
26 | /** |
||
27 | * Output the raw bytes of an IPFS object. |
||
28 | * |
||
29 | * @Endpoint(name="object:data") |
||
30 | * |
||
31 | * @param string $arg key of the object to retrieve, in base58-encoded multihash format |
||
32 | * |
||
33 | * @return Command |
||
34 | */ |
||
35 | public function data(string $arg): Command |
||
39 | |||
40 | /** |
||
41 | * Display the diff between two ipfs objects. |
||
42 | * |
||
43 | * @Endpoint(name="object:diff") |
||
44 | * |
||
45 | * @param string $arg object to diff against |
||
46 | * @param string $arg1 object to diff |
||
47 | * @param bool $verbose print extra information |
||
48 | * |
||
49 | * @return Command |
||
50 | */ |
||
51 | public function diff(string $arg, string $arg1, bool $verbose = false): Command |
||
55 | |||
56 | /** |
||
57 | * Get and serialize the DAG node named by . |
||
58 | * |
||
59 | * @Endpoint(name="object:get") |
||
60 | * |
||
61 | * @param string $arg key of the object to retrieve, in base58-encoded multihash format |
||
62 | * |
||
63 | * @return Command |
||
64 | */ |
||
65 | public function get(string $arg): Command |
||
69 | |||
70 | /** |
||
71 | * Output the links pointed to by the specified object. |
||
72 | * |
||
73 | * @Endpoint(name="object:links") |
||
74 | * |
||
75 | * @param string $arg key of the object to retrieve, in base58-encoded multihash format |
||
76 | * @param bool $headers print table headers (Hash, Size, Name) |
||
77 | * |
||
78 | * @return Command |
||
79 | */ |
||
80 | public function links(string $arg, bool $headers = false): Command |
||
84 | |||
85 | /** |
||
86 | * Create a new object from an ipfs template. |
||
87 | * |
||
88 | * @Endpoint(name="object:new") |
||
89 | * |
||
90 | * @param string $arg template to use |
||
91 | * |
||
92 | * @return Command |
||
93 | */ |
||
94 | public function new(string $arg = null): Command |
||
98 | |||
99 | /** |
||
100 | * Add a link to a given object. |
||
101 | * |
||
102 | * @Endpoint(name="object:patch:add-link") |
||
103 | * |
||
104 | * @param string $arg the hash of the node to modify |
||
105 | * @param string $arg1 name of link to create |
||
106 | * @param string $arg2 IPFS object to add link to |
||
107 | * @param bool $create create intermediary nodes |
||
108 | * |
||
109 | * @return Command |
||
110 | */ |
||
111 | public function patchAddLink(string $arg, string $arg1, string $arg2, bool $create = false): Command |
||
115 | |||
116 | /** |
||
117 | * Append data to the data segment of a dag node. |
||
118 | * |
||
119 | * @Endpoint(name="object:patch:append-data") |
||
120 | * |
||
121 | * @param string $arg the hash of the node to modify |
||
122 | * @param string $file data to append |
||
123 | * |
||
124 | * @return Command |
||
125 | */ |
||
126 | public function patchAppendData(string $arg, string $file): Command |
||
130 | |||
131 | /** |
||
132 | * Remove a link from an object. |
||
133 | * |
||
134 | * @Endpoint(name="object:patch:rm-link") |
||
135 | * |
||
136 | * @param string $arg the hash of the node to modify |
||
137 | * @param string $arg1 name of the link to remove |
||
138 | * |
||
139 | * @return Command |
||
140 | */ |
||
141 | public function patchRmLink(string $arg, string $arg1): Command |
||
145 | |||
146 | /** |
||
147 | * Set the data field of an IPFS object. |
||
148 | * |
||
149 | * @Endpoint(name="object:patch:set-data") |
||
150 | * |
||
151 | * @param string $arg the hash of the node to modify |
||
152 | * @param string $file the data to set the object to |
||
153 | * |
||
154 | * @return Command |
||
155 | */ |
||
156 | public function patchSetData(string $arg, string $file): Command |
||
160 | |||
161 | /** |
||
162 | * Store input as a DAG object, print its key. |
||
163 | * |
||
164 | * @Endpoint(name="object:put") |
||
165 | * |
||
166 | * @param string $file data to be stored as a DAG object |
||
167 | * @param string $inputenc encoding type of input data |
||
168 | * @param string $datafieldenc encoding type of the data field, either “text” or “base64” |
||
169 | * @param bool $pin pin this object when adding |
||
170 | * @param bool $quiet write minimal output |
||
171 | * |
||
172 | * @return Command |
||
173 | */ |
||
174 | public function put(string $file, string $inputenc = 'json', string $datafieldenc = 'text', bool $pin = false, bool $quiet = false): Command |
||
178 | |||
179 | /** |
||
180 | * Get stats for the DAG node named by . |
||
181 | * |
||
182 | * @Endpoint(name="object:stat") |
||
183 | * |
||
184 | * @param string $arg key of the object to retrieve, in base58-encoded multihash format |
||
185 | * |
||
186 | * @return Command |
||
187 | */ |
||
188 | public function stat(string $arg): Command |
||
192 | } |
||
193 |