Add GET /ipinfo/tracker
The endpoint returns the name of tracker. It is used to determine whether the router is running a tracker.
This commit is contained in:
1 parent
9fc7be83c8
commit
de2a70861c
4 files changed
+17
-3
No files matched your search
@@ -53,6 +53,14 @@ func (client *Client) DefaultSubnet() (*net.IPNet, error) {
|
||||
return ipnet, err
|
||||
}
|
||||
|
||||
func (client *Client) LocalRangeTracker() (string, error) {
|
||||
t, err := client.httpVerb("GET", fmt.Sprintf("/ipinfo/tracker"), nil)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func parseIP(body string) (*net.IPNet, error) {
|
||||
ip, ipnet, err := net.ParseCIDR(string(body))
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user