Versions in this module Expand all Collapse all v0 v0.5.2 May 7, 2026 v0.5.1 Apr 16, 2026 v0.5.0 Mar 15, 2026 v0.4.0 Mar 12, 2026 v0.3.3 Mar 12, 2026 Changes in this version + func LoggerEnabled() bool + func Sanitize(v any) any v0.3.2 Mar 12, 2026 v0.3.1 Mar 12, 2026 Changes in this version + var ErrTooManyRequests = TooManyRequests("too many requests") + func SetLogger(l Logger) type Error + func TooManyRequests(message string) *Error + type Logger interface + Error func(ctx context.Context, msg string, args ...any) + func GetLogger() Logger v0.1.2 Mar 10, 2026 v0.1.1 Mar 4, 2026 v0.1.0 Dec 10, 2025 Changes in this version + var CommonTimeFormats = []string + var ErrForbidden = Forbidden("access denied") + var ErrInternalServer = InternalError("internal server error") + var ErrInvalidRequest = BadRequest("invalid request") + var ErrNotImplemented = NotImplemented("not implemented") + var ErrSomethingWentWrong = InternalError("something went wrong") + var ErrUnauthorized = Unauthorized("authentication required") + func HandleError(w http.ResponseWriter, err error) + func HandleResponse(w http.ResponseWriter, response any, err error) + func NewTimeFromString(s string) (time.Time, error) + func WriteJSON(w http.ResponseWriter, data any) + type Error struct + Code int + Details any + ErrorCode string + Message string + RequestID string + func BadRequest(message string) *Error + func Conflict(message string) *Error + func Forbidden(message string) *Error + func GatewayTimeout(message string) *Error + func InternalError(message string) *Error + func NewError(code int, message string) *Error + func NewErrorWithDetails(code int, message string, details any) *Error + func NewErrorf(code int, format string, args ...any) *Error + func NotAcceptable(message string) *Error + func NotFound(resource string) *Error + func NotImplemented(message string) *Error + func ServiceUnavailable(message string) *Error + func Unauthorized(message string) *Error + func UnprocessableEntity(message string) *Error + func WrapError(code int, message string, cause error) *Error + func (e *Error) Error() string + func (e *Error) StatusCode() int + func (e *Error) Unwrap() error + func (e *Error) WithCause(cause error) *Error + func (e *Error) WithDetails(details any) *Error + func (e *Error) WithRequestID(requestID string) *Error + type HttpResponse struct + Body any + ContentType string + Headers map[string]string + StatusCode int + func NewHttpResponse(statusCode int, body any) *HttpResponse + func (r *HttpResponse) WithContentType(contentType string) *HttpResponse + func (r *HttpResponse) WithHeader(key, value string) *HttpResponse + func (r *HttpResponse) WithHeaders(headers map[string]string) *HttpResponse