Documentation
¶
Index ¶
- Constants
- func GetETag(r *http.Request) (*string, error)
- func GetRequestBody[T any](r *http.Request) (*T, error)
- func HandleBundleAPIErr(w http.ResponseWriter, r *http.Request, httpStatusCode int, ...)
- func MapErrorCodeToStatus(code *models.Code) int
- func PtrContentItemState(s models.State) *models.State
Constants ¶
View Source
const (
HeaderIfMatch = "If-Match"
)
Variables ¶
This section is empty.
Functions ¶
func GetETag ¶ added in v1.4.0
GetETag reads the If-Match header from the request, and returns an error if it doesn't exist, otherwise it will return the header value
func GetRequestBody ¶ added in v1.4.0
GetRequestBody attempts to read the request body as JSON and unmarshal it into the specified type T
func HandleBundleAPIErr ¶
func HandleBundleAPIErr(w http.ResponseWriter, r *http.Request, httpStatusCode int, errors ...*models.Error)
HandleBundleAPIErr is a helper function to handle errors and set the HTTP response status code and headers accordingly
func MapErrorCodeToStatus ¶ added in v1.4.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.