Prune Unused Functions from weed/s3api (#8815)

* weed/s3api: prune calculatePartOffset()

* weed/s3api: prune clearCachedListMetadata()

* weed/s3api: prune S3ApiServer.isObjectRetentionActive()

* weed/s3api: prune S3ApiServer.ensureDirectoryAllEmpty()

* weed/s3api: prune s3ApiServer.getEncryptionTypeString()

* weed/s3api: prune newStreamError()

* weed/s3api: prune S3ApiServer.rotateSSECKey()

weed/s3api: prune S3ApiServer.rotateSSEKMSKey()

weed/s3api: prune S3ApiServer.rotateSSEKMSMetadataOnly()

weed/s3api: prune S3ApiServer.rotateSSECChunks()

weed/s3api: prune S3ApiServer.rotateSSEKMSChunks()

weed/s3api: prune S3ApiServer.rotateSSECChunk()

weed/s3api: prune S3ApiServer.rotateSSEKMSChunk()

* weed/s3api: prune addCounterToIV()

* weed/s3api: prune minInt()

* weed/s3api: prune isMethodActionMismatch()

* weed/s3api: prune hasSpecificQueryParameters()

* weed/s3api: prune handlePutToFilerError()

weed/s3api: prune handlePutToFilerInternalError()

weed/s3api: prune logErrorAndReturn()

weed/s3api: prune logInternalError

weed/s3api: prune handleSSEError()

weed/s3api: prune handleSSEInternalError()

* weed/s3api: prune encryptionConfigToProto()

* weed/s3api: prune S3ApiServer.touch()
This commit is contained in:
Lars Lehtonen
2026-03-28 13:24:11 -07:00
committed by GitHub
parent f6ec9941cb
commit b01a74c6bb
12 changed files with 0 additions and 529 deletions

View File

@@ -7,17 +7,6 @@ import (
// ErrorHandlers provide common error handling patterns for S3 API operations
// handlePutToFilerError logs an error and returns the standard putToFiler error format
func handlePutToFilerError(operation string, err error, errorCode s3err.ErrorCode) (string, s3err.ErrorCode, string) {
glog.Errorf("Failed to %s: %v", operation, err)
return "", errorCode, ""
}
// handlePutToFilerInternalError is a convenience wrapper for internal errors in putToFiler
func handlePutToFilerInternalError(operation string, err error) (string, s3err.ErrorCode, string) {
return handlePutToFilerError(operation, err, s3err.ErrInternalError)
}
// handleMultipartError logs an error and returns the standard multipart error format
func handleMultipartError(operation string, err error, errorCode s3err.ErrorCode) (interface{}, s3err.ErrorCode) {
glog.Errorf("Failed to %s: %v", operation, err)
@@ -28,27 +17,3 @@ func handleMultipartError(operation string, err error, errorCode s3err.ErrorCode
func handleMultipartInternalError(operation string, err error) (interface{}, s3err.ErrorCode) {
return handleMultipartError(operation, err, s3err.ErrInternalError)
}
// logErrorAndReturn logs an error with operation context and returns the specified error code
func logErrorAndReturn(operation string, err error, errorCode s3err.ErrorCode) s3err.ErrorCode {
glog.Errorf("Failed to %s: %v", operation, err)
return errorCode
}
// logInternalError is a convenience wrapper for internal error logging
func logInternalError(operation string, err error) s3err.ErrorCode {
return logErrorAndReturn(operation, err, s3err.ErrInternalError)
}
// SSE-specific error handlers
// handleSSEError handles common SSE-related errors with appropriate context
func handleSSEError(sseType string, operation string, err error, errorCode s3err.ErrorCode) (string, s3err.ErrorCode, string) {
glog.Errorf("Failed to %s for %s: %v", operation, sseType, err)
return "", errorCode, ""
}
// handleSSEInternalError is a convenience wrapper for SSE internal errors
func handleSSEInternalError(sseType string, operation string, err error) (string, s3err.ErrorCode, string) {
return handleSSEError(sseType, operation, err, s3err.ErrInternalError)
}