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 28de8ea commit 6bdc92d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

package client

// Options options for bscp sdk
// Options options for bscp sdk client
type Options struct {
// FeedAddr BSCP feed_server address
feedAddrs []string
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ bscp sdk examples
============

## 示例代码
* [config](./config) - bscp 命令行配置文件示例
* [kv-ctl](./kv-ctl) - 拉取 kv 型配置命令行示例
* [pull-file](./pull-file) - 拉取 file 型配置
* [watch-file](./watch-file) - 拉取 file 型配置并监听配置变更
Expand Down
25 changes: 25 additions & 0 deletions examples/config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 订阅地址,必填
feed_addrs:
- "{feed_addr_host}:9510"
# 业务ID,必填
biz: 1
# 服务秘钥,必填
token: "****************"
# 实例标签,选填
labels:
- "region": "nanjing"
- "env": "prod"
# bscp 临时工作目录,选填
temp_dir: "/data/bscp"
# 拉取或监听的服务
apps:
# 服务名称,必填
- name: bscp-demo
# 服务标签(将覆盖实例中相同key的标签),选填
labels:
- "env": "prod"
- "app": "demo"
- name: demo-2
labels:
- "env": "prod"
- "app": "demo-2"
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ bscp-go 是蓝鲸基础配置平台(BK-BSCP)提供的用于快速接入KV SDK,
- [容器化接入](./docs/usage.md)
- [SDK代码示例](./examples/README.md)

## 安装 bscp 命令行
方式1,有 golang 环境,可以直接安装
```
go install github.com/TencentBlueKing/bscp-go/cmd/bscp@latest
bscp version
```

方式2, 安装已编译的二进制,支持 linux/mac/windows, 以 linux 为例
```
wget https://github.com/TencentBlueKing/bscp-go/releases/download/v1.0.5/bscp-v1.0.5-linux-amd64.tar.gz
tar -xf bscp-v1.0.5-linux-amd64.tar.gz
cp bscp /usr/local/bin/
bscp version
```

## Support

- [蓝鲸论坛](https://bk.tencent.com/s-mart/community)
Expand Down
15 changes: 15 additions & 0 deletions readme_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ bscp-go is an official command-line tool provided by BlueKing Basic Configuratio
- [Containerized Access](./docs/usage.md)
- [SDK Examples](./examples/README.md)

## Install bscp cmd
Method 1, with golang environment, you can install it directly
```
go install github.com/TencentBlueKing/bscp-go/cmd/bscp@latest
bscp version
```

Method 2, install the compiled binary, support linux/mac/windows, take linux as an example
```
wget https://github.com/TencentBlueKing/bscp-go/releases/download/v1.0.5/bscp-v1.0.5-linux-amd64.tar.gz
tar -xf bscp-v1.0.5-linux-amd64.tar.gz
cp bscp /usr/local/bin/
bscp version
```

## Support

- [bk forum](https://bk.tencent.com/s-mart/community)
Expand Down

0 comments on commit 6bdc92d

Please sign in to comment.