micro/server/health_checker.go

18 lines
333 B
Go
Raw Normal View History

2015-01-14 02:31:27 +03:00
package server
import (
"github.com/myodc/go-micro/server/proto/health"
2015-05-22 01:06:01 +03:00
"golang.org/x/net/context"
2015-01-14 02:31:27 +03:00
)
2015-05-22 01:06:01 +03:00
type Debug struct{}
func (d *Debug) Health(ctx context.Context, req *health.Request, rsp *health.Response) error {
rsp.Status = "ok"
return nil
}
func registerHealthChecker(r Server) {
r.Register(r.NewReceiver(&Debug{}))
2015-01-14 02:31:27 +03:00
}