diff --git a/contrib/registry/nacos/README.MD b/contrib/registry/nacos/README.MD index 6c76a77d1c1..51ec1114344 100644 --- a/contrib/registry/nacos/README.MD +++ b/contrib/registry/nacos/README.MD @@ -1,24 +1,25 @@ # GoFrame Nacos Registry - Use `nacos` as service registration and discovery management. - ## Installation + ``` go get -u -v github.com/gogf/gf/contrib/registry/nacos/v2 ``` + suggested using `go.mod`: + ``` require github.com/gogf/gf/contrib/registry/nacos/v2 latest ``` - ## Example ### Reference example [server](../../../example/registry/nacos/http/server/main.go) + ```go package main @@ -44,6 +45,7 @@ func main() { ``` [client](../../../example/registry/nacos/http/client/main.go) + ```go package main @@ -78,4 +80,3 @@ func main() { ## License `GoFrame Nacos` is licensed under the [MIT License](../../../LICENSE), 100% free and open-source, forever. - diff --git a/contrib/registry/nacos/go.mod b/contrib/registry/nacos/go.mod index 48c7e198ef6..81afa3ebaef 100644 --- a/contrib/registry/nacos/go.mod +++ b/contrib/registry/nacos/go.mod @@ -4,7 +4,7 @@ go 1.23.0 require ( github.com/gogf/gf/v2 v2.9.8 - github.com/nacos-group/nacos-sdk-go/v2 v2.3.3 + github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 ) require ( diff --git a/contrib/registry/nacos/go.sum b/contrib/registry/nacos/go.sum index 3d3d332ab85..b34fac2f686 100644 --- a/contrib/registry/nacos/go.sum +++ b/contrib/registry/nacos/go.sum @@ -267,8 +267,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nacos-group/nacos-sdk-go/v2 v2.3.3 h1:lvkBZcYkKENLVR1ubO+vGxTP2L4VtVSArLvYZKuu4Pk= -github.com/nacos-group/nacos-sdk-go/v2 v2.3.3/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU= +github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 h1:Hux7C4N4rWhwBF5Zm4yyYskrs9VTgrRTA8DZjoEhQTs= +github.com/nacos-group/nacos-sdk-go/v2 v2.3.5/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= diff --git a/contrib/registry/nacos/nacos.go b/contrib/registry/nacos/nacos.go index 9ecdd3a6af0..bd5ecb6f512 100644 --- a/contrib/registry/nacos/nacos.go +++ b/contrib/registry/nacos/nacos.go @@ -82,7 +82,7 @@ func New(address string, opts ...constant.ClientOption) (reg *Registry) { return } -// New creates and returns registry with Config. +// NewWithConfig creates and returns registry with Config. func NewWithConfig(ctx context.Context, config Config) (reg *Registry, err error) { // Data validation. err = g.Validator().Data(config).Run(ctx) diff --git a/contrib/registry/nacos/nacos_discovery.go b/contrib/registry/nacos/nacos_discovery.go index d9d1eecd9df..5f16ced2483 100644 --- a/contrib/registry/nacos/nacos_discovery.go +++ b/contrib/registry/nacos/nacos_discovery.go @@ -19,7 +19,7 @@ import ( ) // Search searches and returns services with specified condition. -func (reg *Registry) Search(ctx context.Context, in gsvc.SearchInput) (result []gsvc.Service, err error) { +func (reg *Registry) Search(_ context.Context, in gsvc.SearchInput) (result []gsvc.Service, err error) { if in.Prefix == "" && in.Name != "" { in.Prefix = gsvc.NewServiceWithName(in.Name).GetPrefix() } diff --git a/contrib/registry/nacos/nacos_register.go b/contrib/registry/nacos/nacos_register.go index c4c8ceddb55..1b36c8c7b6a 100644 --- a/contrib/registry/nacos/nacos_register.go +++ b/contrib/registry/nacos/nacos_register.go @@ -17,7 +17,7 @@ import ( // Register registers `service` to Registry. // Note that it returns a new Service if it changes the input Service with custom one. -func (reg *Registry) Register(ctx context.Context, service gsvc.Service) (registered gsvc.Service, err error) { +func (reg *Registry) Register(_ context.Context, service gsvc.Service) (registered gsvc.Service, err error) { metadata := map[string]string{} endpoints := service.GetEndpoints() @@ -67,7 +67,7 @@ func (reg *Registry) Register(ctx context.Context, service gsvc.Service) (regist } // Deregister off-lines and removes `service` from the Registry. -func (reg *Registry) Deregister(ctx context.Context, service gsvc.Service) (err error) { +func (reg *Registry) Deregister(_ context.Context, service gsvc.Service) (err error) { c := reg.client for _, endpoint := range service.GetEndpoints() {