mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
519 B
31 lines
519 B
9 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
|
||
|
"github.com/deis/tiller/pkg/hapi"
|
||
|
ctx "golang.org/x/net/context"
|
||
|
"google.golang.org/grpc"
|
||
|
)
|
||
|
|
||
|
type server struct{}
|
||
|
|
||
|
func (s *server) Ready(c ctx.Context, req *hapi.PingRequest) (*hapi.PingResponse, error) {
|
||
|
return &hapi.PingResponse{Status: "OK"}, nil
|
||
|
}
|
||
|
|
||
|
func startServer(addr string) error {
|
||
|
lstn, err := net.Listen("tcp", addr)
|
||
|
if err != nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
hserver := &server{}
|
||
|
|
||
|
srv := grpc.NewServer()
|
||
|
hapi.RegisterProbeServer(srv, hserver)
|
||
|
srv.Serve(lstn)
|
||
|
|
||
|
return nil
|
||
|
}
|