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

Function ReadProtoBody

common/helper.go:15–27  ·  view source on GitHub ↗
(body io.ReadCloser, message proto.Message)

Source from the content-addressed store, hash-verified

13)
14
15func ReadProtoBody(body io.ReadCloser, message proto.Message) error {
16 data, err := io.ReadAll(body)
17 if err != nil {
18 return err
19 }
20 defer body.Close()
21
22 // Decode into a map
23 if err = proto.Unmarshal(data, message); err != nil {
24 return err
25 }
26 return nil
27}
28
29func SendProtoResponse(w http.ResponseWriter, data proto.Message) {
30 response, _ := proto.Marshal(data)

Callers 5

StartMethod · 0.92
GetStatsMethod · 0.92
GetUserOnlineStatMethod · 0.92
GetOutboundsLatencyMethod · 0.92

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected