| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | /* | 
					
						
							|  |  |  |  * Minio Cloud Storage, (C) 2016 Minio, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  |  * you may not use this file except in compliance with the License. | 
					
						
							|  |  |  |  * You may obtain a copy of the License at | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *     http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  |  * distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  |  * See the License for the specific language governing permissions and | 
					
						
							|  |  |  |  * limitations under the License. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-19 05:50:50 +08:00
										 |  |  | package cmd | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | // GenericVolArgs - generic volume args.
 | 
					
						
							|  |  |  | type GenericVolArgs struct { | 
					
						
							|  |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ListVolsReply represents list of vols RPC reply.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | type ListVolsReply struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// List of volumes stat information.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | 	Vols []VolInfo | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-26 05:51:06 +08:00
										 |  |  | // ReadAllArgs represents read all RPC arguments.
 | 
					
						
							|  |  |  | type ReadAllArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-24 10:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-26 05:51:06 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							|  |  |  | 	Path string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ReadFileArgs represents read file RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-05-29 06:13:15 +08:00
										 |  |  | type ReadFileArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-24 10:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							|  |  |  | 	Path string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Starting offset to start reading into Buffer.
 | 
					
						
							| 
									
										
										
										
											2016-05-29 06:13:15 +08:00
										 |  |  | 	Offset int64 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-09 12:35:07 +08:00
										 |  |  | 	// Data buffer read from the path at offset.
 | 
					
						
							|  |  |  | 	Buffer []byte | 
					
						
							| 
									
										
										
										
											2016-05-29 06:13:15 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-17 05:21:52 +08:00
										 |  |  | // ReadFileWithVerifyArgs represents read file RPC arguments.
 | 
					
						
							|  |  |  | type ReadFileWithVerifyArgs struct { | 
					
						
							|  |  |  | 	// Authentication token generated by Login.
 | 
					
						
							|  |  |  | 	AuthRPCArgs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							|  |  |  | 	Path string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Starting offset to start reading into Buffer.
 | 
					
						
							|  |  |  | 	Offset int64 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Data buffer read from the path at offset.
 | 
					
						
							|  |  |  | 	Buffer []byte | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Algorithm used in bit-rot hash computation.
 | 
					
						
							|  |  |  | 	Algo HashAlgo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Stored hash value (hex-encoded) used to compare with
 | 
					
						
							|  |  |  | 	// computed value.
 | 
					
						
							|  |  |  | 	ExpectedHash string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-30 03:44:44 +08:00
										 |  |  | // PrepareFileArgs represents append file RPC arguments.
 | 
					
						
							|  |  |  | type PrepareFileArgs struct { | 
					
						
							|  |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-10-30 03:44:44 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							|  |  |  | 	Path string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Size of the file to be prepared
 | 
					
						
							|  |  |  | 	Size int64 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // AppendFileArgs represents append file RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-05-29 06:13:15 +08:00
										 |  |  | type AppendFileArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							|  |  |  | 	Path string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Data buffer to be saved at path.
 | 
					
						
							| 
									
										
										
										
											2016-05-29 06:13:15 +08:00
										 |  |  | 	Buffer []byte | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // StatFileArgs represents stat file RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | type StatFileArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | 	Path string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // DeleteFileArgs represents delete file RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | type DeleteFileArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							| 
									
										
										
										
											2016-04-09 01:37:38 +08:00
										 |  |  | 	Path string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-05-02 18:12:18 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ListDirArgs represents list contents RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-05-06 03:51:56 +08:00
										 |  |  | type ListDirArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the volume.
 | 
					
						
							|  |  |  | 	Vol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the path.
 | 
					
						
							| 
									
										
										
										
											2016-05-06 03:51:56 +08:00
										 |  |  | 	Path string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // RenameFileArgs represents rename file RPC arguments.
 | 
					
						
							| 
									
										
										
										
											2016-05-02 18:12:18 +08:00
										 |  |  | type RenameFileArgs struct { | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 	// Authentication token generated by Login.
 | 
					
						
							| 
									
										
										
										
											2016-12-23 23:12:19 +08:00
										 |  |  | 	AuthRPCArgs | 
					
						
							| 
									
										
										
										
											2016-08-11 12:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of source volume.
 | 
					
						
							|  |  |  | 	SrcVol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Source path to be renamed.
 | 
					
						
							| 
									
										
										
										
											2016-05-02 18:12:18 +08:00
										 |  |  | 	SrcPath string | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Name of destination volume.
 | 
					
						
							|  |  |  | 	DstVol string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Destination path of renamed file.
 | 
					
						
							| 
									
										
										
										
											2016-05-02 18:12:18 +08:00
										 |  |  | 	DstPath string | 
					
						
							|  |  |  | } |