1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

Strip the verbosity of the debug handler

This commit is contained in:
Asim Aslam
2019-07-28 19:43:50 +01:00
parent 1db98ee0f0
commit a63dcda003
5 changed files with 13 additions and 18 deletions

View File

@ -12,7 +12,7 @@ import (
// used to determine health, status and env info about
// a service node. It's akin to Google's /statusz, /healthz,
// and /varz
type DebugHandler interface {
type Handler interface {
Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error
Stats(ctx context.Context, req *proto.StatsRequest, rsp *proto.StatsResponse) error
}
@ -22,8 +22,13 @@ type debug struct {
started int64
}
// We use this to wrap any debug handlers so we preserve the signature Debug.{Method}
type Debug struct {
Handler
}
var (
DefaultDebugHandler DebugHandler = newDebug()
DefaultHandler Handler = newDebug()
)
func newDebug() *debug {