Skip to content

Commit

Permalink
use changed api of v0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
alex2108 committed Apr 27, 2015
1 parent 6c9425d commit d126ddb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type Device_self struct {
var device_self = Device_self{}

func get_connections() error {
input, _ := query_syncthing(config.Url + "/rest/connections")
input, _ := query_syncthing(config.Url + "/rest/system/connections")

var res map[string]interface{}
err := json.Unmarshal([]byte(input), &res)
Expand All @@ -74,7 +74,7 @@ func get_connections() error {
device[deviceId].connected = false
}

for deviceId, _ := range res {
for deviceId, _ := range res["connections"].(map[string]interface{}) {
if deviceId != "total" {
log.Printf("connected: %d",device_self.devices_connected)
device[deviceId].connected = true
Expand All @@ -86,7 +86,7 @@ func get_connections() error {

func get_folder_state() error {
for key, rep := range folder {
r_json, err := query_syncthing(config.Url + "/rest/model?folder=" + rep.id)
r_json, err := query_syncthing(config.Url + "/rest/db/status?folder=" + rep.id)

if err == nil {
type Folderstate struct {
Expand Down Expand Up @@ -150,7 +150,7 @@ func get_config() error {
device = make(map[string]*Device)
folder = make(map[string]*Folder)

r_json, err := query_syncthing(config.Url + "/rest/config")
r_json, err := query_syncthing(config.Url + "/rest/system/config")

if err == nil {
type SyncthingConfigDevice struct {
Expand Down Expand Up @@ -202,7 +202,7 @@ func get_config() error {

//Display version
log.Println("getting version")
resp, err := query_syncthing(config.Url + "/rest/version")
resp, err := query_syncthing(config.Url + "/rest/system/version")
if err == nil {
type STVersion struct {
Version string
Expand Down Expand Up @@ -363,7 +363,7 @@ func update_ul() error {
for _, n := range r_info.sharedWith {
if device[n].connected { // only query connected devices
//log.Println("device="+ n +"folder=" + r)
out, err := query_syncthing(config.Url + "/rest/completion?device=" + n + "&folder=" + r)
out, err := query_syncthing(config.Url + "/rest/db/completion?device=" + n + "&folder=" + r)
if err != nil {
log.Println(err)
return err
Expand Down

0 comments on commit d126ddb

Please # to comment.