keep track of participating tunnels
This commit is contained in:
@ -27,5 +27,9 @@ func TestAuth(t *testing.T) {
|
|||||||
} else {
|
} else {
|
||||||
t.Log("Your I2P router doesn't need an update")
|
t.Log("Your I2P router doesn't need an update")
|
||||||
}
|
}
|
||||||
|
tunnels, err := ParticipatingTunnels()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Log(tunnels, "Participating tunnels")
|
||||||
}
|
}
|
||||||
|
13
info.go
Normal file
13
info.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package i2pcontrol
|
||||||
|
|
||||||
|
func ParticipatingTunnels() (int, error) {
|
||||||
|
retpre, err := Call("RouterInfo", map[string]interface{}{
|
||||||
|
"i2p.router.net.tunnels.participating": nil,
|
||||||
|
"Token": token,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return -1, err
|
||||||
|
}
|
||||||
|
result := int(retpre["i2p.router.net.tunnels.participating"].(float64))
|
||||||
|
return result, nil
|
||||||
|
}
|
Reference in New Issue
Block a user