mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 01:02:29 +00:00
update grpc, service: implements reflection.GRPCService
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/spf13/cobra"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
@ -119,11 +120,18 @@ func run(opts ...service.Option) {
|
||||
panic(err)
|
||||
}
|
||||
RegisterGreeterServer(svc, &GreeterHandler{})
|
||||
metrics2.Register(svc)
|
||||
go func() {
|
||||
if err := svc.Start(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
http.Handle("/metrics", promhttp.Handler())
|
||||
if err := http.ListenAndServe(":9992", nil); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
<-ready
|
||||
s, err := client.New(
|
||||
// client.WithName(name),
|
||||
|
Reference in New Issue
Block a user