server.go 418 B

12345678910111213141516171819
  1. package grpc
  2. import (
  3. v1pb "go-common/app/service/live/xuserex/api/grpc/v1"
  4. "go-common/app/service/live/xuserex/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.RegisterRoomNoticeServer(wsvr.Server(), svc.RoomNoticeV1Svc())
  11. if wsvr, err = wsvr.Start(); err != nil {
  12. return
  13. }
  14. return
  15. }