grpc.go 422 B

123456789101112131415161718
  1. package grpc
  2. import (
  3. v1pb "go-common/app/service/live/zeus/api/v1"
  4. "go-common/app/service/live/zeus/internal/conf"
  5. v1srv "go-common/app/service/live/zeus/internal/service/v1"
  6. "go-common/library/net/rpc/warden"
  7. )
  8. func New(c *conf.Config, s *v1srv.ZeusService) *warden.Server {
  9. ws := warden.NewServer(nil)
  10. v1pb.RegisterZeusServer(ws.Server(), s)
  11. ws, err := ws.Start()
  12. if err != nil {
  13. panic(err)
  14. }
  15. return ws
  16. }