2021-04-19 03:41:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Copyright (c) 2015-2021 MinIO, Inc.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// This file is part of MinIO Object Storage stack
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// This program is free software: you can redistribute it and/or modify
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// it under the terms of the GNU Affero General Public License as published by
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// the Free Software Foundation, either version 3 of the License, or
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// (at your option) any later version.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// This program is distributed in the hope that it will be useful
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// but WITHOUT ANY WARRANTY; without even the implied warranty of
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// GNU Affero General Public License for more details.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// You should have received a copy of the GNU Affero General Public License
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 07:23:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								package  cmd  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  (  
						 
					
						
							
								
									
										
										
										
											2020-05-05 05:33:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									"context" 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-08 01:13:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									"errors" 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									"fmt" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"io" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// Converts underlying storage error. Convenience function written to
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// handle all cases where we have known types of errors returned by
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// underlying storage layer.
  
						 
					
						
							
								
									
										
										
										
											2024-04-26 08:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  toObjectErr ( oerr  error ,  params  ... string )  error  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  oerr  ==  nil  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  nil 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-26 00:39:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// Unwarp the error first
 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-26 08:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									err  :=  unwrapAll ( oerr ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-26 00:39:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  err  ==  context . Canceled  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-24 03:59:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  context . Canceled 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-26 00:39:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  err . Error ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  errVolumeNotFound . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  BucketNotFound { } 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errVolumeNotEmpty . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  BucketNotEmpty { } 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-05 16:35:21 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-05 16:35:21 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errVolumeExists . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  BucketExists { } 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errDiskFull . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  StorageFull { } 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errTooManyOpenFiles . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  SlowDown { } 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errFileAccessDenied . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  PrefixAccessDenied { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-21 07:09:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-21 07:09:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errIsNotRegular . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  ObjectExistsAsDirectory { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errFileVersionNotFound . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  VersionNotFound { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  3  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . VersionID  =  params [ 2 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errMethodNotAllowed . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  MethodNotAllowed { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errFileNotFound . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  ObjectNotFound { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errUploadIDNotFound . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  InvalidUploadID { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  3  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . UploadID  =  params [ 2 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errFileNameTooLong . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  ObjectNameInvalid { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-12 03:55:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-12 03:55:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errDataTooLarge . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  ObjectTooLarge { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 00:05:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 00:05:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errDataTooSmall . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  ObjectTooSmall { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 14:47:03 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 14:47:03 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errErasureReadQuorum . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  InsufficientReadQuorum { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-26 08:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  v ,  ok  :=  oerr . ( InsufficientReadQuorum ) ;  ok  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Type  =  v . Type 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-21 00:00:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  errErasureWriteQuorum . Error ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apiErr  :=  InsufficientWriteQuorum { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-27 02:17:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-07 02:47:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  io . ErrUnexpectedEOF . Error ( ) ,  io . ErrShortWrite . Error ( ) ,  context . Canceled . Error ( ) ,  context . DeadlineExceeded . Error ( ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										apiErr  :=  IncompleteBody { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  1  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Bucket  =  params [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  len ( params )  >=  2  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											apiErr . Object  =  decodeDirObject ( params [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  apiErr 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-26 00:39:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									return  err 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-11 07:52:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// SignatureDoesNotMatch - when content md5 does not match with what was sent from client.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  SignatureDoesNotMatch  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  SignatureDoesNotMatch )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "The request signature we calculated does not match the signature you provided. Check your key and signing method." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// StorageFull storage ran out of space.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  StorageFull  struct { }  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  StorageFull )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2022-08-05 07:10:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Storage reached its minimum free drive threshold." 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-02 22:09:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// SlowDown  too many file descriptors open or backend busy .
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  SlowDown  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  SlowDown )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Please reduce your request rate" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-26 08:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// RQErrType reason for read quorum error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  RQErrType  int  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// RQInsufficientOnlineDrives - not enough online drives.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RQInsufficientOnlineDrives  RQErrType  =  1  <<  iota 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// RQInconsistentMeta - inconsistent metadata.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RQInconsistentMeta 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( t  RQErrType )  String ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  t  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  RQInsufficientOnlineDrives : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  "InsufficientOnlineDrives" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  RQInconsistentMeta : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  "InconsistentMeta" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  "Unknown" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-06 11:24:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// InsufficientReadQuorum storage cannot satisfy quorum for read operation.
  
						 
					
						
							
								
									
										
										
										
											2024-04-26 08:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  InsufficientReadQuorum  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Bucket  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Err     error 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Type    RQErrType 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-06 11:24:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  InsufficientReadQuorum )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Storage resources are insufficient for the read operation "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-29 00:18:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Unwrap the error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InsufficientReadQuorum )  Unwrap ( )  error  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errErasureReadQuorum 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-06 11:24:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// InsufficientWriteQuorum storage cannot satisfy quorum for write operation.
  
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  InsufficientWriteQuorum  GenericError  
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-06 11:24:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  InsufficientWriteQuorum )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Storage resources are insufficient for the write operation "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 08:23:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-29 00:18:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Unwrap the error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InsufficientWriteQuorum )  Unwrap ( )  error  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errErasureWriteQuorum 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// GenericError - generic object layer error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  GenericError  struct  {  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Bucket     string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object     string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VersionID  string 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 08:36:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Err        error 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-24 01:12:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Unwrap the error to its underlying error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  GenericError )  Unwrap ( )  error  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  e . Err 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 08:36:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// InvalidArgument incorrect input argument
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  InvalidArgument  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidArgument )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  e . Err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  "Invalid arguments provided for "  +  e . Bucket  +  "/"  +  e . Object  +  ": ("  +  e . Err . Error ( )  +  ")" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Invalid arguments provided for "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 10:17:33 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// BucketNotFound bucket does not exist.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  BucketNotFound  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket not found: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-09 05:53:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketAlreadyExists the requested bucket name is not available.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketAlreadyExists  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketAlreadyExists )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-04-28 02:26:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketAlreadyOwnedByYou already owned by you.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketAlreadyOwnedByYou  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketAlreadyOwnedByYou )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket already owned by you: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// BucketNotEmpty bucket is not empty.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  BucketNotEmpty  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-17 02:26:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketNotEmpty )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket not empty: "  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-29 13:15:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// InvalidVersionID invalid version id
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  InvalidVersionID  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidVersionID )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Invalid version id: "  +  e . Bucket  +  "/"  +  e . Object  +  "("  +  e . VersionID  +  ")" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// VersionNotFound version does not exist.
  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  VersionNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  VersionNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Version not found: "  +  e . Bucket  +  "/"  +  e . Object  +  "("  +  e . VersionID  +  ")" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// ObjectNotFound object does not exist.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  ObjectNotFound  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectNotFound )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Object not found: "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// MethodNotAllowed on the object
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  MethodNotAllowed  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  MethodNotAllowed )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Method not allowed: "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-30 23:22:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// ObjectLocked object is currently WORM protected.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectLocked  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectLocked )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Object is WORM protected and cannot be overwritten: "  +  e . Bucket  +  "/"  +  e . Object  +  "("  +  e . VersionID  +  ")" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-28 07:44:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// ObjectAlreadyExists object already exists.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectAlreadyExists  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectAlreadyExists )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Object: "  +  e . Bucket  +  "/"  +  e . Object  +  " already exists" 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-28 07:44:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-09 03:36:16 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// ObjectExistsAsDirectory object already exists as a directory.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectExistsAsDirectory  GenericError  
						 
					
						
							
								
									
										
										
										
											2016-02-03 07:23:28 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-09 03:36:16 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectExistsAsDirectory )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Object exists on : "  +  e . Bucket  +  " as directory "  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-17 01:28:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// PrefixAccessDenied object access is denied.
  
						 
					
						
							
								
									
										
										
										
											2016-10-21 07:09:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  PrefixAccessDenied  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  PrefixAccessDenied )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2019-08-07 03:08:58 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Prefix access is denied: "  +  e . Bucket  +  SlashSeparator  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-21 07:09:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// BucketExists bucket exists.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  BucketExists  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-06-24 02:44:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketExists )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket exists: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// InvalidUploadIDKeyCombination - invalid upload id and key marker combination.
  
						 
					
						
							
								
									
										
										
										
											2016-04-11 16:29:18 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  InvalidUploadIDKeyCombination  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									UploadIDMarker ,  KeyMarker  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidUploadIDKeyCombination )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "Invalid combination of uploadID marker '%s' and marker '%s'" ,  e . UploadIDMarker ,  e . KeyMarker ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												accessPolicy: Implement Put, Get, Delete access policy.
This patch implements Get,Put,Delete bucket policies
Supporting - http://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html
Currently supports following actions.
   "*":                             true,
   "s3:*":                          true,
   "s3:GetObject":                  true,
   "s3:ListBucket":                 true,
   "s3:PutObject":                  true,
   "s3:CreateBucket":               true,
   "s3:GetBucketLocation":          true,
   "s3:DeleteBucket":               true,
   "s3:DeleteObject":               true,
   "s3:AbortMultipartUpload":       true,
   "s3:ListBucketMultipartUploads": true,
   "s3:ListMultipartUploadParts":   true,
following conditions for "StringEquals" and "StringNotEquals"
   "s3:prefix", "s3:max-keys"
											 
										 
										
											2016-02-04 08:46:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// BucketPolicyNotFound - no bucket policy found.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  BucketPolicyNotFound  GenericError  
						 
					
						
							
								
									
										
										
											
												accessPolicy: Implement Put, Get, Delete access policy.
This patch implements Get,Put,Delete bucket policies
Supporting - http://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html
Currently supports following actions.
   "*":                             true,
   "s3:*":                          true,
   "s3:GetObject":                  true,
   "s3:ListBucket":                 true,
   "s3:PutObject":                  true,
   "s3:CreateBucket":               true,
   "s3:GetBucketLocation":          true,
   "s3:DeleteBucket":               true,
   "s3:DeleteObject":               true,
   "s3:AbortMultipartUpload":       true,
   "s3:ListBucketMultipartUploads": true,
   "s3:ListMultipartUploadParts":   true,
following conditions for "StringEquals" and "StringNotEquals"
   "s3:prefix", "s3:max-keys"
											 
										 
										
											2016-02-04 08:46:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketPolicyNotFound )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-05-09 04:44:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "No bucket policy configuration found for bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
											
												accessPolicy: Implement Put, Get, Delete access policy.
This patch implements Get,Put,Delete bucket policies
Supporting - http://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html
Currently supports following actions.
   "*":                             true,
   "s3:*":                          true,
   "s3:GetObject":                  true,
   "s3:ListBucket":                 true,
   "s3:PutObject":                  true,
   "s3:CreateBucket":               true,
   "s3:GetBucketLocation":          true,
   "s3:DeleteBucket":               true,
   "s3:DeleteObject":               true,
   "s3:AbortMultipartUpload":       true,
   "s3:ListBucketMultipartUploads": true,
   "s3:ListMultipartUploadParts":   true,
following conditions for "StringEquals" and "StringNotEquals"
   "s3:prefix", "s3:max-keys"
											 
										 
										
											2016-02-04 08:46:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-20 04:20:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketLifecycleNotFound - no bucket lifecycle found.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketLifecycleNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketLifecycleNotFound )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-05-09 04:44:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "No bucket lifecycle configuration found for bucket : "  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-05 17:42:34 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-09 04:44:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketSSEConfigNotFound - no bucket encryption found
  
						 
					
						
							
								
									
										
										
										
											2020-02-05 17:42:34 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  BucketSSEConfigNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketSSEConfigNotFound )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-05-09 04:44:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "No bucket encryption configuration found for bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// BucketTaggingNotFound - no bucket tags found
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketTaggingNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketTaggingNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "No bucket tags found for bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// BucketObjectLockConfigNotFound - no bucket object lock config found
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketObjectLockConfigNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketObjectLockConfigNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "No bucket object lock configuration found for bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-20 04:20:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-01 06:55:54 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketQuotaConfigNotFound - no bucket quota config found.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketQuotaConfigNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketQuotaConfigNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "No quota config found for bucket : "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// BucketQuotaExceeded - bucket quota exceeded.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketQuotaExceeded  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketQuotaExceeded )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket quota exceeded for bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-22 08:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketReplicationConfigNotFound - no bucket replication config found
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketReplicationConfigNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketReplicationConfigNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "The replication configuration was not found: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 01:54:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteDestinationNotFound bucket does not exist.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteDestinationNotFound  GenericError  
						 
					
						
							
								
									
										
										
										
											2020-07-22 08:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 01:54:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  BucketRemoteDestinationNotFound )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-07-22 08:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Destination bucket does not exist: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-31 10:55:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteTargetNotFound remote target does not exist.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteTargetNotFound  GenericError  
						 
					
						
							
								
									
										
										
										
											2020-07-22 08:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-31 10:55:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  BucketRemoteTargetNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote target not found: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-17 08:46:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// RemoteTargetConnectionErr remote target connection failure.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  RemoteTargetConnectionErr  struct  {  
						 
					
						
							
								
									
										
										
										
											2022-12-14 19:24:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Err        error 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Bucket     string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Endpoint   string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									AccessKey  string 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-17 08:46:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2020-09-04 23:48:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-17 08:46:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  RemoteTargetConnectionErr )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  e . Bucket  !=  ""  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-14 19:24:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  fmt . Sprintf ( "Remote service endpoint offline, target bucket: %s or remote service credentials: %s invalid \n\t%s" ,  e . Bucket ,  e . AccessKey ,  e . Err . Error ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-17 08:46:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "Remote service endpoint %s not available\n\t%s" ,  e . Endpoint ,  e . Err . Error ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-04 23:48:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-07 04:35:43 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteIdenticalToSource remote already exists for this target type.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteIdenticalToSource  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GenericError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Endpoint  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteIdenticalToSource )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "Remote service endpoint %s is self referential to current cluster" ,  e . Endpoint ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-31 10:55:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteAlreadyExists remote already exists for this target type.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteAlreadyExists  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteAlreadyExists )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote already exists for this bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 01:54:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteLabelInUse remote already exists for this target label.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteLabelInUse  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteLabelInUse )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote with this label already exists for this bucket: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-31 10:55:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteArnTypeInvalid arn type for remote is not valid.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteArnTypeInvalid  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteArnTypeInvalid )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote ARN type not valid: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// BucketRemoteArnInvalid arn needs to be specified.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteArnInvalid  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteArnInvalid )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote ARN has invalid format: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// BucketRemoteRemoveDisallowed when replication configuration exists
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteRemoveDisallowed  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketRemoteRemoveDisallowed )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Replication configuration exists with this ARN:"  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-22 08:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 01:54:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketRemoteTargetNotVersioned remote target does not have versioning enabled.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketRemoteTargetNotVersioned  GenericError  
						 
					
						
							
								
									
										
										
										
											2020-07-23 08:39:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 01:54:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  BucketRemoteTargetNotVersioned )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Remote target does not have versioning enabled: "  +  e . Bucket 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 08:39:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-07 08:10:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BucketReplicationSourceNotVersioned replication source does not have versioning enabled.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BucketReplicationSourceNotVersioned  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketReplicationSourceNotVersioned )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Replication source does not have versioning enabled: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-20 01:30:42 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// TransitionStorageClassNotFound remote tier not configured.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  TransitionStorageClassNotFound  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  TransitionStorageClassNotFound )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Transition storage class not found " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// InvalidObjectState restore-object doesn't apply for the current state of the object.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  InvalidObjectState  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidObjectState )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2021-04-27 09:24:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "The operation is not valid for the current state of the object "  +  e . Bucket  +  "/"  +  e . Object  +  "("  +  e . VersionID  +  ")" 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-20 01:30:42 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-17 01:28:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Bucket related errors.
  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// BucketNameInvalid - bucketname provided is invalid.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  BucketNameInvalid  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  BucketNameInvalid )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Bucket name invalid: "  +  e . Bucket 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-17 01:28:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Object related errors.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// ObjectNameInvalid - object name provided is invalid.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  ObjectNameInvalid  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:38:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// ObjectNameTooLong - object name too long.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectNameTooLong  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// ObjectNamePrefixAsSlash - object name has a slash as prefix.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectNamePrefixAsSlash  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectNameInvalid )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Object name invalid: "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:38:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  ObjectNameTooLong )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Object name too long: "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:38:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:38:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  ObjectNamePrefixAsSlash )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2024-01-18 15:03:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Object name contains forward slash as prefix: "  +  e . Bucket  +  "/"  +  e . Object 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:38:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-06 09:49:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// AllAccessDisabled All access to this object has been disabled
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  AllAccessDisabled  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2017-05-06 09:49:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  ( e  AllAccessDisabled )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "All access to this object has been disabled" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-28 10:28:13 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// IncompleteBody You did not provide the number of bytes specified by the Content-Length HTTP header.
  
						 
					
						
							
								
									
										
										
										
											2016-04-19 17:42:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  IncompleteBody  GenericError  
						 
					
						
							
								
									
										
										
										
											2015-07-09 11:18:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 07:19:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Error returns string an error formatted as the given text.
  
						 
					
						
							
								
									
										
										
										
											2015-07-09 11:18:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  ( e  IncompleteBody )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2022-07-06 03:19:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  e . Bucket  +  "/"  +  e . Object  +  " has incomplete body" 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-09 11:18:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-07-09 08:22:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// InvalidRange - invalid range typed error.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  InvalidRange  struct  {  
						 
					
						
							
								
									
										
										
										
											2017-11-14 16:25:10 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									OffsetBegin   int64 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									OffsetEnd     int64 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ResourceSize  int64 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-09 08:22:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidRange )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2024-05-06 00:56:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "The requested range 'bytes=%d-%d' is not satisfiable" ,  e . OffsetBegin ,  e . OffsetEnd ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-09 08:22:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 00:05:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectTooLarge  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectTooLarge )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "size of the object greater than what is allowed(5G)" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 14:47:03 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// ObjectTooSmall error returned when the size of the object < what is expected.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ObjectTooSmall  GenericError  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ObjectTooSmall )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "size of the object less than what is expected" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-09-01 02:29:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// OperationTimedOut - a timeout occurred.
  
						 
					
						
							
								
									
										
										
										
											2022-01-03 01:15:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  OperationTimedOut  struct { }  
						 
					
						
							
								
									
										
										
										
											2017-09-01 02:29:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  OperationTimedOut )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2020-02-21 13:59:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  "Operation timed out" 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-01 02:29:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-17 01:28:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// Multipart related errors.
  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-11 16:29:18 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// MalformedUploadID malformed upload id.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  MalformedUploadID  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									UploadID  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  MalformedUploadID )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Malformed upload id "  +  e . UploadID 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// InvalidUploadID invalid upload id.
  
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  InvalidUploadID  struct  {  
						 
					
						
							
								
									
										
										
										
											2019-04-24 05:54:28 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Bucket    string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object    string 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-01 07:30:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									UploadID  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidUploadID )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Invalid upload id "  +  e . UploadID 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-09 07:54:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-14 10:29:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// InvalidPart One or more of the specified parts could not be found
  
						 
					
						
							
								
									
										
										
										
											2018-08-15 09:35:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  InvalidPart  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PartNumber  int 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ExpETag     string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GotETag     string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-14 10:29:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidPart )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2018-08-15 09:35:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "Specified part could not be found. PartNumber %d, Expected %s, got %s" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										e . PartNumber ,  e . ExpETag ,  e . GotETag ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-14 10:29:32 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-05-09 03:06:05 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// PartTooSmall - error if part size is less than 5MB.
  
						 
					
						
							
								
									
										
										
										
											2016-06-29 05:51:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								type  PartTooSmall  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PartSize    int64 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PartNumber  int 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PartETag    string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-05-09 03:06:05 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  PartTooSmall )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2017-10-28 06:07:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  fmt . Sprintf ( "Part size for %d should be at least 5MB" ,  e . PartNumber ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-09 03:06:05 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-08-18 02:36:33 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-13 07:42:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// PartTooBig returned if size of part is bigger than the allowed limit.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  PartTooBig  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  PartTooBig )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Part size bigger than the allowed limit" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-13 12:34:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// InvalidETag error returned when the etag has changed on disk
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  InvalidETag  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  InvalidETag )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "etag of the object has changed" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-25 08:44:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// BackendDown is returned for network errors
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  BackendDown  struct  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Err  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  BackendDown )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  e . Err 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 02:36:33 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								// NotImplemented If a feature is not implemented
  
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								type  NotImplemented  struct  {  
						 
					
						
							
								
									
										
										
										
											2021-04-16 07:20:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Message  string 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-13 11:04:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-08-18 02:36:33 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  NotImplemented )  Error ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2021-04-16 07:20:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  e . Message 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 02:36:33 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-11-17 08:42:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-09-13 07:14:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// UnsupportedMetadata - unsupported metadata
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  UnsupportedMetadata  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  UnsupportedMetadata )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Unsupported headers in Metadata" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-20 09:42:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrBucketNotFound - Check if error type is BucketNotFound.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrBucketNotFound ( err  error )  bool  {  
						 
					
						
							
								
									
										
										
										
											2024-05-16 06:19:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  errors . Is ( err ,  errVolumeNotFound )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-08 01:13:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									var  bkNotFound  BucketNotFound 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & bkNotFound ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-20 09:42:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-22 14:26:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrReadQuorum check if the error type is InsufficientReadQuorum
  
						 
					
						
							
								
									
										
										
										
											2023-04-12 02:17:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  isErrReadQuorum ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									var  rquorum  InsufficientReadQuorum 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & rquorum ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-22 14:26:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrWriteQuorum check if the error type is InsufficientWriteQuorum
  
						 
					
						
							
								
									
										
										
										
											2023-11-21 13:33:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								func  isErrWriteQuorum ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									var  rquorum  InsufficientWriteQuorum 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & rquorum ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-14 16:25:10 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrObjectNotFound - Check if error type is ObjectNotFound.
  
						 
					
						
							
								
									
										
										
										
											2016-11-17 08:42:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								func  isErrObjectNotFound ( err  error )  bool  {  
						 
					
						
							
								
									
										
										
										
											2024-05-16 06:19:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  errors . Is ( err ,  errFileNotFound )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-08 01:13:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									var  objNotFound  ObjectNotFound 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & objNotFound ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-17 08:42:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2019-03-07 04:38:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-03 07:17:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrVersionNotFound - Check if error type is VersionNotFound.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrVersionNotFound ( err  error )  bool  {  
						 
					
						
							
								
									
										
										
										
											2024-05-16 06:19:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  errors . Is ( err ,  errFileVersionNotFound )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-03 07:17:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									var  versionNotFound  VersionNotFound 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & versionNotFound ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-20 01:30:42 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// isErrSignatureDoesNotMatch - Check if error type is SignatureDoesNotMatch.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrSignatureDoesNotMatch ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									var  signatureDoesNotMatch  SignatureDoesNotMatch 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & signatureDoesNotMatch ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-07 04:38:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// PreConditionFailed - Check if copy precondition failed
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  PreConditionFailed  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  PreConditionFailed )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "At least one of the pre-conditions you specified did not hold" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrPreconditionFailed ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									_ ,  ok  :=  err . ( PreConditionFailed ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  ok 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2021-08-24 05:48:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// isErrMethodNotAllowed - Check if error type is MethodNotAllowed.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrMethodNotAllowed ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									var  methodNotAllowed  MethodNotAllowed 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  errors . As ( err ,  & methodNotAllowed ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2022-03-09 05:58:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isErrInvalidRange ( err  error )  bool  {  
						 
					
						
							
								
									
										
										
										
											2024-05-06 00:56:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  errors . Is ( err ,  errInvalidRange )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 07:56:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									_ ,  ok  :=  err . ( InvalidRange ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  ok 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-09 05:58:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2023-07-11 11:09:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// ReplicationPermissionCheck - Check if error type is ReplicationPermissionCheck.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								type  ReplicationPermissionCheck  struct { }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  ( e  ReplicationPermissionCheck )  Error ( )  string  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  "Replication permission validation requests cannot be completed" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								func  isReplicationPermissionCheck ( err  error )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									_ ,  ok  :=  err . ( ReplicationPermissionCheck ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  ok 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}