docs: 更新 module 引用示例
This commit is contained in:
10
README.md
10
README.md
@@ -19,7 +19,7 @@ OpenWrt 特供插件: [Mmx233/BitSrunLoginGo_Openwrt](https://github.com/Mmx23
|
|||||||
支持 `json`、`yaml`、`yml`、`toml`、`hcl`、`tfvars` 等,仅对 `json`和`yaml` 进行了优化与测试
|
支持 `json`、`yaml`、`yml`、`toml`、`hcl`、`tfvars` 等,仅对 `json`和`yaml` 进行了优化与测试
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./autoLogin --config=/demo/i.json
|
./bitsrun --config=/demo/i.json
|
||||||
```
|
```
|
||||||
|
|
||||||
其他 Flags:
|
其他 Flags:
|
||||||
@@ -156,12 +156,12 @@ golang 支持的系统与架构请自行查询
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Mmx233/BitSrunLoginGo/v1"
|
"github.com/Mmx233/BitSrunLoginGo/pkg/srun"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
//具体用法请查看struct注释
|
//具体用法请查看struct注释
|
||||||
conf:=&BitSrun.Conf{
|
conf:=&srun.Conf{
|
||||||
Https: false,
|
Https: false,
|
||||||
Client: nil,
|
Client: nil,
|
||||||
LoginInfo: BitSrun.LoginInfo{
|
LoginInfo: BitSrun.LoginInfo{
|
||||||
@@ -180,13 +180,13 @@ func main() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
online, clientIP, e := BitSrun.LoginStatus(conf)
|
online, clientIP, e := srun.LoginStatus(conf)
|
||||||
if e!=nil {
|
if e!=nil {
|
||||||
panic(e)
|
panic(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !online {
|
if !online {
|
||||||
e=BitSrun.DoLogin(clientIP, conf)
|
e=srun.DoLogin(clientIP, conf)
|
||||||
if e!=nil {
|
if e!=nil {
|
||||||
panic(e)
|
panic(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user