(inlineArgs []string, cfg *config.Map)
| 52 | } |
| 53 | |
| 54 | func (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 | |
| 78 | func (e *Endpoint) Name() string { |
| 79 | return modName |
nothing calls this directly
no test coverage detected