server.go 417 B

123456789101112131415161718
  1. package grpc
  2. import (
  3. pb "go-common/app/service/bbq/notice-service/api/v1"
  4. "go-common/app/service/bbq/notice-service/internal/service"
  5. "go-common/library/net/rpc/warden"
  6. )
  7. // New new warden rpc server
  8. func New(c *warden.ServerConfig, svc *service.Service) *warden.Server {
  9. ws := warden.NewServer(c)
  10. pb.RegisterNoticeServer(ws.Server(), svc)
  11. ws, err := ws.Start()
  12. if err != nil {
  13. panic(err)
  14. }
  15. return ws
  16. }