4 saastool工具
saastool 是提供给客户的便捷命令行工具,使客户在不开发或少开发的情况下即可实现【数据管理】【策略管理】的对应功能。
开发者也可以参考该工具的功能源码(golang),实现贴合自身业务的处理逻辑。
源码:saastool
4.1 命令行模式
saastool help
Usage: saastool COMMAND [OPTIONS]
Commands:
info Saas Info
write Write user's 'bytes / uint32s / flags'
read Read user's 'bytes / uint32s / flags'
columnwrite Write columns for 'deviceid / openid' users
convert Convert data to write format
task Task commands
target Target commands
bind Bind commands
script Script commands
"help" is the default command.
Use "saastool COMMAND -help" for more information about a command.
4.1.1 cfg.toml配置文件
saastool需要一个配置文件,其中可填写自己的Account、Token。使用配置文件可实现多账号多环境的区分。
该配置文件默认名称为 cfg.toml
,请置于saastool 同目录下。也可以通过 -cfg 参数指定别的配置文件,例如 saastool -cfg my.toml
。
# 样例
[auth]
account = "2000"
token = "test"
[apiurls]
baseurl = "https://api.rta.qq.com" # 正式环境
#baseurl = "https://srta.algo.com.cn" # 演示环境