MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / writeJSON

Function writeJSON

internal/auth/auth.go:172–176  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, payload any)

Source from the content-addressed store, hash-verified

170}
171
172func writeJSON(w http.ResponseWriter, status int, payload any) {
173 w.Header().Set("Content-Type", "application/json; charset=utf-8")
174 w.WriteHeader(status)
175 _ = json.NewEncoder(w).Encode(payload)
176}
177
178// Login 验证凭据并创建新的 session token。ip 用于暴力破解防护(可传空字符串跳过)。
179func (m *Manager) Login(username, password string) (string, error) {

Callers 4

MiddlewareMethod · 0.70
HandleLoginMethod · 0.70
HandleLogoutMethod · 0.70
HandleMeMethod · 0.70

Calls 1

WriteHeaderMethod · 0.80

Tested by

no test coverage detected