(fn *Function, code int, msgf string, a ...any)
| 811 | } |
| 812 | |
| 813 | func (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 | } |
no test coverage detected