containerd/services/healthcheck/service.go
Michael Crosby 4f2b443a27 Rewrite imports for new github org
This rewrites the Go imports after switching to the new github org.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-03 14:05:44 -07:00

31 lines
596 B
Go

package healthcheck
import (
"github.com/containerd/containerd/plugin"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
)
type Service struct {
serve *health.Server
}
func init() {
plugin.Register("healthcheck-grpc", &plugin.Registration{
Type: plugin.GRPCPlugin,
Init: NewService,
})
}
func NewService(ic *plugin.InitContext) (interface{}, error) {
return &Service{
health.NewServer(),
}, nil
}
func (s *Service) Register(server *grpc.Server) error {
grpc_health_v1.RegisterHealthServer(server, s.serve)
return nil
}