MCPcopy Index your code
hub / github.com/PasarGuard/node / SendProtoResponse

Function SendProtoResponse

common/helper.go:29–37  ·  view source on GitHub ↗
(w http.ResponseWriter, data proto.Message)

Source from the content-addressed store, hash-verified

27}
28
29func SendProtoResponse(w http.ResponseWriter, data proto.Message) {
30 response, _ := proto.Marshal(data)
31
32 w.Header().Set("Content-Type", "application/x-protobuf")
33 if _, err := w.Write(response); err != nil {
34 http.Error(w, "Failed to write response", http.StatusInternalServerError)
35 return
36 }
37}
38
39func EnsureBase64Password(password string, method string) string {
40 // First check if it's already a valid base64 string

Callers 10

BaseMethod · 0.92
StartMethod · 0.92
StopMethod · 0.92
GetStatsMethod · 0.92
GetUserOnlineStatMethod · 0.92
GetBackendStatsMethod · 0.92
GetOutboundsLatencyMethod · 0.92
GetSystemStatsMethod · 0.92
SyncUsersChunkedMethod · 0.92

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected