server.go 403 B

1234567891011121314151617
  1. package grpc
  2. import (
  3. v1pb "go-common/app/service/live/xanchor/api/grpc/v1"
  4. "go-common/app/service/live/xanchor/service"
  5. "go-common/library/net/rpc/warden"
  6. )
  7. // New new grpc server
  8. func New(svc *service.Service) (wsvr *warden.Server, err error) {
  9. wsvr = warden.NewServer(nil)
  10. v1pb.RegisterXAnchorServer(wsvr.Server(), svc.V1Svc())
  11. if wsvr, err = wsvr.Start(); err != nil {
  12. return
  13. }
  14. return
  15. }