MCPcopy
hub / github.com/usefathom/fathom / respond

Function respond

pkg/api/http.go:42–47  ·  view source on GitHub ↗
(w http.ResponseWriter, statusCode int, d interface{})

Source from the content-addressed store, hash-verified

40}
41
42func respond(w http.ResponseWriter, statusCode int, d interface{}) error {
43 w.Header().Set("Content-Type", "application/json")
44 w.WriteHeader(statusCode)
45 err := json.NewEncoder(w).Encode(d)
46 return err
47}
48
49func serveFileHandler(box *packr.Box, filename string) http.Handler {
50 return HandlerFunc(serveFile(box, filename))

Callers 15

GetSitesHandlerMethod · 0.85
SaveSiteHandlerMethod · 0.85
DeleteSiteHandlerMethod · 0.85
GetSiteStatsHandlerMethod · 0.85
GetSessionMethod · 0.85
CreateSessionMethod · 0.85
DeleteSessionMethod · 0.85
AuthorizeMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestRespondFunction · 0.68