MCPcopy Create free account
hub / github.com/foxcpp/maddy / Configure

Method Configure

internal/endpoint/openmetrics/om.go:54–76  ·  view source on GitHub ↗
(inlineArgs []string, cfg *config.Map)

Source from the content-addressed store, hash-verified

52}
53
54func (e *Endpoint) Configure(inlineArgs []string, cfg *config.Map) error {
55 cfg.Bool("debug", false, false, &e.logger.Debug)
56 if _, err := cfg.Process(); err != nil {
57 return err
58 }
59
60 e.mux = http.NewServeMux()
61 e.mux.Handle("/metrics", promhttp.Handler())
62 e.serv.Handler = e.mux
63
64 for _, a := range e.addrs {
65 endp, err := config.ParseEndpoint(a)
66 if err != nil {
67 return fmt.Errorf("%s: malformed endpoint: %v", modName, err)
68 }
69 if endp.IsTLS() {
70 return fmt.Errorf("%s: TLS is not supported yet", modName)
71 }
72 e.endpoints = append(e.endpoints, endp)
73 }
74
75 return nil
76}
77
78func (e *Endpoint) Name() string {
79 return modName

Callers

nothing calls this directly

Calls 4

ParseEndpointFunction · 0.92
BoolMethod · 0.80
ProcessMethod · 0.80
IsTLSMethod · 0.80

Tested by

no test coverage detected