feat 包命名规范
This commit is contained in:
24
net/grpc/grpcclient/client_qgdzs.go
Normal file
24
net/grpc/grpcclient/client_qgdzs.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package grpcclient
|
||||
|
||||
import (
|
||||
"git.hlsq.asia/mmorpg/service-common/discover"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/grpc/resolver"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/rs/rspb"
|
||||
)
|
||||
|
||||
func QgdzsNewClient(sid ...int64) (rspb.QgdzsClient, error) {
|
||||
c, err := discover.FindServer(common.KeyDiscoverQgdzs, sid...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rspb.NewQgdzsClient(c), nil
|
||||
}
|
||||
|
||||
func QgdzsNewClientLB() (rspb.QgdzsClient, error) {
|
||||
c, err := resolver.GetGrpcClientConn("etcd:///" + common.KeyDiscoverServiceNameQgdzs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rspb.NewQgdzsClient(c), nil
|
||||
}
|
||||
Reference in New Issue
Block a user