MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / writeJSON

Function writeJSON

internal/auth/auth.go:30–34  ·  view source on GitHub ↗

writeJSON encodes payload as the response body and logs encode errors rather than swallowing them — useful for debugging truncated responses when a client drops mid-write.

(w http.ResponseWriter, payload any)

Source from the content-addressed store, hash-verified

28// rather than swallowing them — useful for debugging truncated responses
29// when a client drops mid-write.
30func writeJSON(w http.ResponseWriter, payload any) {
31 if err := json.NewEncoder(w).Encode(payload); err != nil {
32 log.Printf("[auth] json encode failed: %v", err)
33 }
34}
35
36const (
37 SessionCookieName = "e2a_session"

Callers 7

HandleMeMethod · 0.70
HandleUpdateMeMethod · 0.70
HandleDashboardStatsMethod · 0.70
HandleDashboardAgentsMethod · 0.70
HandleAgentActivityMethod · 0.70
HandleCreateAPIKeyMethod · 0.70
HandleListAPIKeysMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected