docs: 更新readme

This commit is contained in:
Mmx233
2022-03-02 19:27:58 +08:00
parent 9fd1fcd252
commit a588eef2e1

View File

@@ -46,7 +46,7 @@ golang支持的系统与架构请自行查询
编译结果为可执行文件,直接启动即可 编译结果为可执行文件,直接启动即可
可以通过添加启动参数`--config`指定配置文件路径,默认为当前目录的`Config.json` 可以通过添加启动参数`--config`指定配置文件路径,默认为当前目录的`Config.yaml`
支持`json``yaml``yml``toml``hcl``tfvars`等,仅对`json``yaml`进行了优化与测试 支持`json``yaml``yml``toml``hcl``tfvars`等,仅对`json``yaml`进行了优化与测试
@@ -54,7 +54,7 @@ golang支持的系统与架构请自行查询
./autoLogin --config=/demo/i.json ./autoLogin --config=/demo/i.json
``` ```
首次运行将自动生成配置文件以json为例 首次运行将自动生成配置文件
Config.json说明 Config.json说明
@@ -74,7 +74,7 @@ Config.json说明
}, },
"settings": { "settings": {
"basic": { //基础设置 "basic": { //基础设置
"demo_mode": false, //测试模式,报错更详细,且生成运行日志与错误日志 "https": false, //访问校园网API时直接使用http URL
"interfaces": "", //网卡名称正则注意JSON转义eth0\\.[2-3],不为空时为多网卡模式 "interfaces": "", //网卡名称正则注意JSON转义eth0\\.[2-3],不为空时为多网卡模式
"skip_net_check": false, //是否跳过网络检查(仅非守护模式) "skip_net_check": false, //是否跳过网络检查(仅非守护模式)
"timeout": 5 //网络请求超时时间(秒) "timeout": 5 //网络请求超时时间(秒)
@@ -87,6 +87,11 @@ Config.json说明
"enable": false, "enable": false,
"path": ".BitSrun", //守护监听文件路径,确保只有单守护运行 "path": ".BitSrun", //守护监听文件路径,确保只有单守护运行
}, },
"debug": {
"enable": false, //开启debug模式报错将更加详细
"write_log": false, //写日志文件
"log_path": "./" //日志文件存放路径
}
} }
} }
``` ```
@@ -112,10 +117,12 @@ import (
func main() { func main() {
//具体用法请查看struct注释 //具体用法请查看struct注释
if e:=BitSrun.Login(&srunTransfer.Login{ if e:=BitSrun.Login(&srunTransfer.Login{
Demo: false, Https: false,
OutPut: false, OutPut: false,
Debug: false,
WriteLog: false,
CheckNet: false, CheckNet: false,
Timeout: 0, Transport: nil,
LoginInfo: srunTransfer.LoginInfo{ LoginInfo: srunTransfer.LoginInfo{
Form: &srunTransfer.LoginForm{ Form: &srunTransfer.LoginForm{
Domain: "", Domain: "",
@@ -130,7 +137,6 @@ func main() {
Enc: "", Enc: "",
}, },
}, },
LocalAddr: nil, //出口地址
});e!=nil { });e!=nil {
panic(e) panic(e)
} }