Documentation ¶
Index ¶
- Constants
- func FailureResponse(ctx context.Context, err error) render.Renderer
- func HandleResult(w http.ResponseWriter, r *http.Request, ctx context.Context, err error, ...)
- func Response(ctx context.Context, data any, err error) render.Renderer
- func SuccessResponse(ctx context.Context, data any) render.Renderer
- type Duration
- type Payload
Constants ¶
View Source
const SuccessMessage = "OK"
SuccessMessage is the default success message for successful responses.
Variables ¶
This section is empty.
Functions ¶
func FailureResponse ¶
FailureResponse creates a response renderer for a failed request.
func HandleResult ¶
HandleResult is a handler function that writes the response to the HTTP response writer based on the provided error and data.
Types ¶
type Duration ¶
Duration is a custom type that represents a duration of time.
func (Duration) MarshalJSON ¶
MarshalJSON customizes JSON representation of the Duration type.
Click to show internal directories.
Click to hide internal directories.