MCPcopy Index your code
hub / github.com/coder/coder / HandleNetcheck

Method HandleNetcheck

agent/health.go:12–31  ·  view source on GitHub ↗
(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

10)
11
12func (a *agent) HandleNetcheck(rw http.ResponseWriter, r *http.Request) {
13 ni := a.TailnetConn().GetNetInfo()
14
15 ifReport, err := healthsdk.RunInterfacesReport()
16 if err != nil {
17 httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{
18 Message: "Failed to run interfaces report",
19 Detail: err.Error(),
20 })
21 return
22 }
23
24 httpapi.Write(r.Context(), rw, http.StatusOK, healthsdk.AgentNetcheckReport{
25 BaseReport: healthsdk.BaseReport{
26 Severity: health.SeverityOK,
27 },
28 NetInfo: ni,
29 Interfaces: ifReport,
30 })
31}

Callers

nothing calls this directly

Calls 6

TailnetConnMethod · 0.95
RunInterfacesReportFunction · 0.92
WriteFunction · 0.92
GetNetInfoMethod · 0.80
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected