Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package dao
import (
"go-common/app/job/live/push-search/conf"
userApi "go-common/app/service/live/user/api/liverpc"
relationApi "go-common/app/service/live/relation/api/liverpc"
roomApi "go-common/app/service/live/room/api/liverpc"
"go-common/library/net/rpc/liverpc"
)
var UserApi *userApi.Client
var RelationApi *relationApi.Client
var RoomApi *roomApi.Client
// InitAPI init all service APIs
func InitAPI() {
UserApi = userApi.New(getConf("user"))
RelationApi = relationApi.New(getConf("relation"))
RoomApi = roomApi.New(getConf("room"))
}
func getConf(appName string) *liverpc.ClientConfig {
c := conf.Conf.LiveRpc
if c != nil {
return c[appName]
}
return nil
}