Skip to content
Snippets Groups Projects
Commit a89f93cb authored by fangyincheng's avatar fangyincheng
Browse files

Mod:change method name

parent 22458df0
No related branches found
No related tags found
No related merge requests found
......@@ -240,7 +240,7 @@ func Load() (map[string]*ReferenceConfig, map[string]*ServiceConfig) {
length := len(consumerConfig.References)
for index := 0; index < length; index++ {
con := &consumerConfig.References[index]
rpcService := GetConService(con.InterfaceName)
rpcService := GetConsumerService(con.InterfaceName)
if rpcService == nil {
log.Warn("%s is not exsist!", con.InterfaceName)
continue
......@@ -283,7 +283,7 @@ func Load() (map[string]*ReferenceConfig, map[string]*ServiceConfig) {
length := len(providerConfig.Services)
for index := 0; index < length; index++ {
pro := &providerConfig.Services[index]
rpcService := GetProService(pro.InterfaceName)
rpcService := GetProviderService(pro.InterfaceName)
if rpcService == nil {
log.Warn("%s is not exsist!", pro.InterfaceName)
continue
......
......@@ -56,8 +56,8 @@ func TestLoad(t *testing.T) {
doInit()
doinit()
SetConService(&MockService{})
SetProService(&MockService{})
SetConsumerService(&MockService{})
SetProviderService(&MockService{})
extension.SetProtocol("registry", GetProtocol)
extension.SetCluster("registryAware", cluster_impl.NewRegistryAwareCluster)
......
......@@ -24,19 +24,19 @@ var (
)
// SetConService is called by init() of implement of RPCService
func SetConService(service common.RPCService) {
func SetConsumerService(service common.RPCService) {
conServices[service.Service()] = service
}
// SetProService is called by init() of implement of RPCService
func SetProService(service common.RPCService) {
func SetProviderService(service common.RPCService) {
proServices[service.Service()] = service
}
func GetConService(name string) common.RPCService {
func GetConsumerService(name string) common.RPCService {
return conServices[name]
}
func GetProService(name string) common.RPCService {
func GetProviderService(name string) common.RPCService {
return proServices[name]
}
......@@ -32,7 +32,7 @@ import (
type Gender hessian.JavaEnum
func init() {
config.SetConService(new(UserProvider))
config.SetConsumerService(new(UserProvider))
}
const (
......
......@@ -33,7 +33,7 @@ import (
type Gender hessian.JavaEnum
func init() {
config.SetProService(new(UserProvider))
config.SetProviderService(new(UserProvider))
}
const (
......
......@@ -25,7 +25,7 @@ import (
)
func init() {
config.SetConService(new(UserProvider))
config.SetConsumerService(new(UserProvider))
}
type JsonRPCUser struct {
......
......@@ -31,7 +31,7 @@ import (
type Gender int
func init() {
config.SetProService(new(UserProvider))
config.SetProviderService(new(UserProvider))
}
const (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment