Server wraps a HTTP and gRPC server, and some common initialization. Servers will be automatically instrumented for Prometheus metrics.
| 271 | // |
| 272 | // Servers will be automatically instrumented for Prometheus metrics. |
| 273 | type Server struct { |
| 274 | cfg Config |
| 275 | handler SignalHandler |
| 276 | grpcListener net.Listener |
| 277 | httpListener net.Listener |
| 278 | |
| 279 | HTTP *mux.Router |
| 280 | HTTPServer *http.Server |
| 281 | GRPC *grpc.Server |
| 282 | Log gokit_log.Logger |
| 283 | Registerer prometheus.Registerer |
| 284 | Gatherer prometheus.Gatherer |
| 285 | } |
| 286 | |
| 287 | // New makes a new Server. It will panic if the metrics cannot be registered. |
| 288 | func New(cfg Config) (*Server, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected