Discover Packages
github.com/scrot/musclemem-api
internal
api
package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Feb 24, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
ReadJSON reads the Request and returns the decoded payload
as T. The request body needs to be closed by the caller
WriteInternalError handles generic server errors logging the error and writing
the error response
WriteJSON encodes v as json and writes to the ResponseWriter
setting the proper headers. It protects writing invalid json
and returns an error instead.
const (
TypeJSONObject TypeJSON = iota
TypeJSONArray
TypeJSONUnknown
TypeJSONInvalid
)
JSONType detects if the JSON payload is an array or an object
Source Files
¶
Click to show internal directories.
Click to hide internal directories.