micro/server/debug/debug.go
Jelmer Snoeck 3cefc39aff Debug: use the DebugHandler interface.
Without specifying the interface, DefaultDebugHandler has to be of type
*"github.com/micro/go-micro/server/debug".debug.
2016-01-07 10:15:30 +00:00

28 lines
662 B
Go

package debug
import (
proto "github.com/micro/go-micro/server/debug/proto"
"golang.org/x/net/context"
)
// The debug handler represents an internal server handler
// 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 {
Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error
}
// Our own internal handler
type debug struct{}
var (
DefaultDebugHandler DebugHandler = new(debug)
)
func (d *debug) Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error {
rsp.Status = "ok"
return nil
}