MCPcopy
hub / github.com/netdata/netdata / respf

Method respf

src/go/plugin/framework/functions/manager.go:813–832  ·  view source on GitHub ↗
(fn *Function, code int, msgf string, a ...any)

Source from the content-addressed store, hash-verified

811}
812
813func (m *Manager) respf(fn *Function, code int, msgf string, a ...any) {
814 if fn == nil || fn.UID == "" {
815 return
816 }
817
818 msg := fmt.Sprintf(msgf, a...)
819 bs := BuildJSONPayload(code, msg)
820
821 res := netdataapi.FunctionResult{
822 UID: fn.UID,
823 ContentType: "application/json",
824 Payload: string(bs),
825 Code: strconv.Itoa(code),
826 ExpireTimestamp: strconv.FormatInt(time.Now().Unix(), 10),
827 }
828
829 m.finalizeTerminal(fn.UID, "functions.manager.respf", func() {
830 m.api.FUNCRESULT(res)
831 })
832}

Callers 3

dispatchInvocationMethod · 0.95
respUIDMethod · 0.95

Calls 3

finalizeTerminalMethod · 0.95
BuildJSONPayloadFunction · 0.85
FUNCRESULTMethod · 0.80

Tested by

no test coverage detected