diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -686,6 +686,22 @@ func handleAPIDuplicates(w http.ResponseWriter, r *http.Request) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +func handleAPIOrphans(w http.ResponseWriter, r *http.Request) { + var params struct{} + if err := json.NewDecoder(r.Body).Decode(¶ms); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + // TODO + result := false + if err := json.NewEncoder(w).Encode(result); err != nil { + log.Println(err) + } +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // cmdRun runs a web UI against GD on ADDRESS. func cmdRun(args []string) error { if len(args) != 2 { @@ -708,6 +724,7 @@ func cmdRun(args []string) error { http.HandleFunc("/api/info", handleAPIInfo) http.HandleFunc("/api/similar", handleAPISimilar) http.HandleFunc("/api/duplicates", handleAPIDuplicates) + http.HandleFunc("/api/orphans", handleAPIOrphans) host, port, err := net.SplitHostPort(address) if err != nil { |