2016-01-06 22:24:54 +03:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/micro/go-micro/server/debug"
|
|
|
|
proto "github.com/micro/go-micro/server/debug/proto"
|
|
|
|
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// We use this to wrap any debug handlers so we preserve the signature Debug.{Method}
|
|
|
|
type Debug struct {
|
|
|
|
debug.DebugHandler
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Debug) Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error {
|
|
|
|
return d.DebugHandler.Health(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func registerDebugHandler(s Server) {
|
2016-01-08 17:02:32 +03:00
|
|
|
s.Handle(s.NewHandler(&Debug{s.Options().DebugHandler}, InternalHandler(true)))
|
2016-01-06 22:24:54 +03:00
|
|
|
}
|