Skip to content

Commit

Permalink
Update README to demonstrate how to configure polaris (gogf#2724)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgd16 authored Jun 28, 2023
1 parent 8aff085 commit 92e21c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contrib/registry/polaris/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
conf := config.NewDefaultConfiguration([]string{"183.47.111.80:8091"})

// TTL egt 2*time.Second
gsvc.SetRegistry(polaris.NewRegistryWithConfig(conf, polaris.WithTTL(10)))
gsvc.SetRegistry(polaris.NewWithConfig(conf, polaris.WithTTL(10)))

s := g.Server(`hello.svc`)
s.BindHandler("/", func(r *ghttp.Request) {
Expand Down Expand Up @@ -70,7 +70,7 @@ import (
func main() {
conf := config.NewDefaultConfiguration([]string{"183.47.111.80:8091"})

gsvc.SetRegistry(polaris.NewRegistryWithConfig(conf, polaris.WithTTL(10)))
gsvc.SetRegistry(polaris.NewWithConfig(conf, polaris.WithTTL(10)))

for i := 0; i < 100; i++ {
res, err := g.Client().Get(gctx.New(), `http://hello.svc/`)
Expand Down
6 changes: 3 additions & 3 deletions contrib/registry/polaris/README_ZH.MD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
conf := config.NewDefaultConfiguration([]string{"183.47.111.80:8091"})

// TTL egt 2*time.Second
gsvc.SetRegistry(polaris.NewRegistryWithConfig(conf, polaris.WithTTL(10)))
gsvc.SetRegistry(polaris.NewWithConfig(conf, polaris.WithTTL(10)))

s := g.Server(`hello.svc`)
s.BindHandler("/", func(r *ghttp.Request) {
Expand Down Expand Up @@ -77,7 +77,7 @@ import (
func main() {
conf := config.NewDefaultConfiguration([]string{"183.47.111.80:8091"})

gsvc.SetRegistry(polaris.NewRegistryWithConfig(conf, polaris.WithTTL(10)))
gsvc.SetRegistry(polaris.NewWithConfig(conf, polaris.WithTTL(10)))

for i := 0; i < 100; i++ {
res, err := g.Client().Get(gctx.New(), `http://hello.svc/`)
Expand All @@ -94,4 +94,4 @@ func main() {

## 协议

`GoFrame Polaris` 使用非常友好的 [MIT](../../../LICENSE) 开源协议进行发布,永久`100%`开源免费。
`GoFrame Polaris` 使用非常友好的 [MIT](../../../LICENSE) 开源协议进行发布,永久`100%`开源免费。

0 comments on commit 92e21c2

Please sign in to comment.