Documentation
¶
Index ¶
- func CompressedJSONResponse(w http.ResponseWriter, statusCode int, data any)
- func JSONFromRequest(r *http.Request, data any) error
- func JSONResponse(w http.ResponseWriter, statusCode int, data any)
- func PossiblyCompressedJSONResponse(w http.ResponseWriter, r *http.Request, statusCode int, data any)
- func Start(errorCallback func(error))
- func Stop()
- type Dir
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressedJSONResponse ¶ added in v5.21.0
func CompressedJSONResponse(w http.ResponseWriter, statusCode int, data any)
CompressedJSONResponse writes a compressed JSON response with a status code.
func JSONFromRequest ¶ added in v5.21.0
JSONFromRequest extracts JSON content from the body of the request.
func JSONResponse ¶ added in v5.21.0
func JSONResponse(w http.ResponseWriter, statusCode int, data any)
JSONResponse writes a JSON response with a status code.
func PossiblyCompressedJSONResponse ¶ added in v5.28.1
func PossiblyCompressedJSONResponse(w http.ResponseWriter, r *http.Request, statusCode int, data any)
PossiblyCompressedJSONResponse responds with compressed JSON if supported.
Types ¶
type Dir ¶ added in v5.21.0
type Dir struct { Name string `json:"name"` Files []string `json:"files,omitempty"` Dirs []*Dir `json:"dirs,omitempty"` }
Dir is a directory listing.
Click to show internal directories.
Click to hide internal directories.