Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NotImplemented http.HandlerFunc = func(w http.ResponseWriter, _ *http.Request) { w.Header().Set(headers.ContentType, "application/json") w.WriteHeader(http.StatusNotImplemented) _, _ = w.Write([]byte(`{"status":"error","error":"This operation is not yet implemented"}`)) }
NotImplemented is a placeholder handler for routes that are registered but not yet implemented. It returns a 501 JSON response.
Functions ¶
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, requestID string, errCode s3types.ErrorCode, additionalErrorCallbacks ...ErrorModifier) error
WriteErrorResponse writes an S3-compatible XML error response. The HTTP status code is derived from errCode. If err is non-nil, its message overrides the error code's default description.
func WriteXMLResponse ¶
func WriteXMLResponse(w http.ResponseWriter, statusCode int, data any) error
WriteXMLResponse writes an HTTP response in XML format with the XML declaration header. It buffers the encoded output before writing so that headers are only sent on success.
Types ¶
type ErrorModifier ¶
type ErrorModifier func(errResponse s3types.ErrorResponse) s3types.ErrorResponse
func SetErrAsMessage ¶
func SetErrAsMessage(err error) ErrorModifier
type XMLErrorWriter ¶
type XMLErrorWriter func(w http.ResponseWriter, requestID string, errCode s3types.ErrorCode, additionalErrorCallbacks ...ErrorModifier) error