Skip to content

Commit

Permalink
refactor: refine client opts
Browse files Browse the repository at this point in the history
  • Loading branch information
ifooth committed Dec 15, 2023
1 parent fc1252f commit 28de8ea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bscp sdk examples
添加环境变量
```bash
# FEED 地址
export BSCP_FEED_ADDRS="bscp-feed.example.com:9510"
export BSCP_FEED_ADDR="bscp-feed.example.com:9510"
# 服务密钥 Token, 记得需要关联配置文件
export BSCP_TOKEN="xxx"
# 当前业务
Expand Down
2 changes: 1 addition & 1 deletion examples/kv-ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func execute() {
}

bscp, err := client.New(
client.WithFeedAddrs(strings.Split(os.Getenv("BSCP_FEED_ADDRS"), ",")),
client.WithFeedAddr(os.Getenv("BSCP_FEED_ADDR")),
client.WithBizID(uint32(biz)),
client.WithToken(os.Getenv("BSCP_TOKEN")),
client.WithLabels(labels),
Expand Down
3 changes: 1 addition & 2 deletions examples/pull-kv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"encoding/json"
"os"
"strconv"
"strings"

"golang.org/x/exp/slog"

Expand Down Expand Up @@ -45,7 +44,7 @@ func main() {
}

bscp, err := client.New(
client.WithFeedAddrs(strings.Split(os.Getenv("BSCP_FEED_ADDRS"), ",")),
client.WithFeedAddr(os.Getenv("BSCP_FEED_ADDRS")),
client.WithBizID(uint32(biz)),
client.WithToken(os.Getenv("BSCP_TOKEN")),
client.WithLabels(labels),
Expand Down
3 changes: 1 addition & 2 deletions examples/watch-file/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"os"
"os/signal"
"strconv"
"strings"
"syscall"

"golang.org/x/exp/slog"
Expand All @@ -41,7 +40,7 @@ func main() {
}

bscp, err := client.New(
client.WithFeedAddrs(strings.Split(os.Getenv("BSCP_FEED_ADDRS"), ",")),
client.WithFeedAddr(os.Getenv("BSCP_FEED_ADDR")),
client.WithBizID(uint32(biz)),
client.WithToken(os.Getenv("BSCP_TOKEN")),
)
Expand Down
3 changes: 1 addition & 2 deletions examples/watch-kv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"os"
"os/signal"
"strconv"
"strings"
"syscall"

"golang.org/x/exp/slog"
Expand Down Expand Up @@ -48,7 +47,7 @@ func main() {
}

bscp, err := client.New(
client.WithFeedAddrs(strings.Split(os.Getenv("BSCP_FEED_ADDRS"), ",")),
client.WithFeedAddr(os.Getenv("BSCP_FEED_ADDR")),
client.WithBizID(uint32(biz)),
client.WithToken(os.Getenv("BSCP_TOKEN")),
client.WithLabels(labels),
Expand Down

0 comments on commit 28de8ea

Please sign in to comment.