response

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL