package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Jun 13, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
AbortWith writes an error envelope and aborts the handler chain.
Use this inside middleware or when you need to stop further processing.
response.AbortWith(c, http.StatusUnauthorized, "missing token")
Data writes a 200 (or any 2xx) success envelope.
response.OK(c, gin.H{"id": 42})
response.OK(c, http.StatusCreated, createdUser)
Error writes an error envelope. The data field will be null.
response.Fail(c, http.StatusNotFound, "user not found")
type Body struct {
Data any `json:"data"`
Error *string `json:"error"`
}
Body is the top-level JSON shape returned by every endpoint.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.