diff --git a/client/options.go b/client/options.go index 74dfa7e9a..b732af064 100644 --- a/client/options.go +++ b/client/options.go @@ -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 diff --git a/examples/README.md b/examples/README.md index dbe3931f4..0709a1f40 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 型配置并监听配置变更 diff --git a/examples/config/config.yml b/examples/config/config.yml new file mode 100644 index 000000000..570eced6c --- /dev/null +++ b/examples/config/config.yml @@ -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" diff --git a/readme.md b/readme.md index 6f78e7e70..c16c46a34 100644 --- a/readme.md +++ b/readme.md @@ -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) diff --git a/readme_en.md b/readme_en.md index 28be95931..eccf40675 100644 --- a/readme_en.md +++ b/readme_en.md @@ -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)