server.go 553 B

12345678910111213141516171819202122232425
  1. package grpc
  2. import (
  3. dmg "go-common/app/service/live/live-dm/api/grpc/v1"
  4. "go-common/app/service/live/live-dm/conf"
  5. "go-common/app/service/live/live-dm/dao"
  6. dms "go-common/app/service/live/live-dm/service/v1"
  7. "go-common/library/net/rpc/warden"
  8. )
  9. //Init 弹幕grpc 初始化
  10. func Init(c *conf.Config) {
  11. dao.InitAPI()
  12. dao.InitGrpc(c)
  13. dao.InitIPdb()
  14. dao.InitDatabus(c)
  15. dao.InitLancer(c)
  16. dao.InitTitan()
  17. s := warden.NewServer(nil)
  18. dmg.RegisterDMServer(s.Server(), dms.NewDMService(c))
  19. _, err := s.Start()
  20. if err != nil {
  21. panic(err)
  22. }
  23. }