feat: registry.
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
package nacos
|
||||
|
||||
import (
|
||||
nacosKratos "github.com/go-kratos/kratos/contrib/registry/nacos/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
nacosClients "github.com/nacos-group/nacos-sdk-go/clients"
|
||||
nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
|
||||
nacosVo "github.com/nacos-group/nacos-sdk-go/vo"
|
||||
nacosClients "github.com/nacos-group/nacos-sdk-go/v2/clients"
|
||||
nacosConstant "github.com/nacos-group/nacos-sdk-go/v2/common/constant"
|
||||
nacosVo "github.com/nacos-group/nacos-sdk-go/v2/vo"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Nacos
|
||||
func NewRegistry(c *conf.Registry) *nacosKratos.Registry {
|
||||
func NewRegistry(c *conf.Registry) *Registry {
|
||||
if c == nil || c.Nacos == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -43,7 +42,7 @@ func NewRegistry(c *conf.Registry) *nacosKratos.Registry {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
reg := nacosKratos.New(cli)
|
||||
reg := New(cli)
|
||||
|
||||
return reg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user