diff --git a/rpc.go b/rpc.go index 3142174..be4d3c2 100644 --- a/rpc.go +++ b/rpc.go @@ -13,17 +13,23 @@ import ( "go.uber.org/zap" ) +var ( + // Request 请求实例 + Request *request +) + // InitRPC 初始化RPC服务 // // Author : go_developer@163.com<白茶清欢> // // Date : 15:23 2022/6/29 -func InitRPC(serviceTable map[string]Service, loggerInstance *zap.Logger) *request { - return &request{ +func InitRPC(serviceTable map[string]Service, loggerInstance *zap.Logger) error { + Request = &request{ logger: loggerInstance, serviceTable: serviceTable, lock: &sync.RWMutex{}, } + return nil } type request struct {