MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Config

Function Config

pkg/api/handler/config.go:27–33  ·  view source on GitHub ↗

Config is the handler the serves the current configuration state as pretty-formatted text.

(c *config.Config)

Source from the content-addressed store, hash-verified

25
26// Config is the handler the serves the current configuration state as pretty-formatted text.
27func Config(c *config.Config) http.Handler {
28 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
29 if _, err := w.Write([]byte(c.Print())); err != nil {
30 http.Error(w, err.Error(), http.StatusInternalServerError)
31 }
32 })
33}

Callers 1

setupServerFunction · 0.92

Calls 3

PrintMethod · 0.80
WriteMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected