api.go 454 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "go-common/app/interface/live/live-demo/conf"
  4. room_api "go-common/app/service/live/room/api/liverpc"
  5. "go-common/library/net/rpc/liverpc"
  6. )
  7. // RoomAPI liverpc room-service api
  8. var RoomAPI *room_api.Client
  9. // InitAPI init all service APIs
  10. func InitAPI() {
  11. RoomAPI = room_api.New(getConf("room"))
  12. }
  13. func getConf(appName string) *liverpc.ClientConfig {
  14. c := conf.Conf.LiveRpc
  15. if c != nil {
  16. return c[appName]
  17. }
  18. return nil
  19. }