Skip to content

Commit 0a82036

Browse files
yuluo-yxhailazCopilot
authored
feat(contrib/registry): update nacos sdk to 2.3.5 (gogf#4628)
- Update nacos go sdk to 2.3.5; - ctx params not use, skip it; - adjust docs style --------- Signed-off-by: yuluo-yx <yuluo08290126@gmail.com> Co-authored-by: hailaz <739476267@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b4053ed commit 0a82036

6 files changed

Lines changed: 12 additions & 11 deletions

File tree

contrib/registry/nacos/README.MD

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# GoFrame Nacos Registry
22

3-
43
Use `nacos` as service registration and discovery management.
54

6-
75
## Installation
6+
87
```
98
go get -u -v github.com/gogf/gf/contrib/registry/nacos/v2
109
```
10+
1111
suggested using `go.mod`:
12+
1213
```
1314
require github.com/gogf/gf/contrib/registry/nacos/v2 latest
1415
```
1516

16-
1717
## Example
1818

1919
### Reference example
2020

2121
[server](../../../example/registry/nacos/http/server/main.go)
22+
2223
```go
2324
package main
2425

@@ -44,6 +45,7 @@ func main() {
4445
```
4546

4647
[client](../../../example/registry/nacos/http/client/main.go)
48+
4749
```go
4850
package main
4951

@@ -78,4 +80,3 @@ func main() {
7880
## License
7981

8082
`GoFrame Nacos` is licensed under the [MIT License](../../../LICENSE), 100% free and open-source, forever.
81-

contrib/registry/nacos/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.0
44

55
require (
66
github.com/gogf/gf/v2 v2.9.8
7-
github.com/nacos-group/nacos-sdk-go/v2 v2.3.3
7+
github.com/nacos-group/nacos-sdk-go/v2 v2.3.5
88
)
99

1010
require (

contrib/registry/nacos/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
267267
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
268268
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
269269
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
270-
github.com/nacos-group/nacos-sdk-go/v2 v2.3.3 h1:lvkBZcYkKENLVR1ubO+vGxTP2L4VtVSArLvYZKuu4Pk=
271-
github.com/nacos-group/nacos-sdk-go/v2 v2.3.3/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU=
270+
github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 h1:Hux7C4N4rWhwBF5Zm4yyYskrs9VTgrRTA8DZjoEhQTs=
271+
github.com/nacos-group/nacos-sdk-go/v2 v2.3.5/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU=
272272
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
273273
github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM=
274274
github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=

contrib/registry/nacos/nacos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func New(address string, opts ...constant.ClientOption) (reg *Registry) {
8282
return
8383
}
8484

85-
// New creates and returns registry with Config.
85+
// NewWithConfig creates and returns registry with Config.
8686
func NewWithConfig(ctx context.Context, config Config) (reg *Registry, err error) {
8787
// Data validation.
8888
err = g.Validator().Data(config).Run(ctx)

contrib/registry/nacos/nacos_discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
// Search searches and returns services with specified condition.
22-
func (reg *Registry) Search(ctx context.Context, in gsvc.SearchInput) (result []gsvc.Service, err error) {
22+
func (reg *Registry) Search(_ context.Context, in gsvc.SearchInput) (result []gsvc.Service, err error) {
2323
if in.Prefix == "" && in.Name != "" {
2424
in.Prefix = gsvc.NewServiceWithName(in.Name).GetPrefix()
2525
}

contrib/registry/nacos/nacos_register.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
// Register registers `service` to Registry.
1919
// Note that it returns a new Service if it changes the input Service with custom one.
20-
func (reg *Registry) Register(ctx context.Context, service gsvc.Service) (registered gsvc.Service, err error) {
20+
func (reg *Registry) Register(_ context.Context, service gsvc.Service) (registered gsvc.Service, err error) {
2121
metadata := map[string]string{}
2222
endpoints := service.GetEndpoints()
2323

@@ -67,7 +67,7 @@ func (reg *Registry) Register(ctx context.Context, service gsvc.Service) (regist
6767
}
6868

6969
// Deregister off-lines and removes `service` from the Registry.
70-
func (reg *Registry) Deregister(ctx context.Context, service gsvc.Service) (err error) {
70+
func (reg *Registry) Deregister(_ context.Context, service gsvc.Service) (err error) {
7171
c := reg.client
7272

7373
for _, endpoint := range service.GetEndpoints() {

0 commit comments

Comments
 (0)