diff options
author | Jakob Borg <jakob@nym.se> | 2014-05-12 22:08:55 -0300 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-05-12 22:08:55 -0300 |
commit | 532b576fd59fd60d556f62bdbab70b3fbb6e54e0 (patch) | |
tree | 3c707f4d5af65e4e57fe295701cc46efe9dfe4f9 /cmd | |
parent | dd1197236d3942232ec17bc4c3c0c4815603f387 (diff) |
Expose discovery cache over rest interface
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/syncthing/gui.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 83b2fe32c8..d88478bcdb 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -49,6 +49,7 @@ func startGUI(cfg GUIConfiguration, m *Model) error { router.Get("/rest/config/sync", restGetConfigInSync) router.Get("/rest/system", restGetSystem) router.Get("/rest/errors", restGetErrors) + router.Get("/rest/discovery", restGetDiscovery) router.Post("/rest/config", restPostConfig) router.Post("/rest/restart", restPostRestart) @@ -243,6 +244,10 @@ func restPostDiscoveryHint(r *http.Request) { } } +func restGetDiscovery(w http.ResponseWriter) { + json.NewEncoder(w).Encode(discoverer.All()) +} + func basic(username string, passhash string) http.HandlerFunc { return func(res http.ResponseWriter, req *http.Request) { error := func() { |