From d945fe936d250877e141fce748783d4fc7d591de Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sat, 23 Dec 2023 07:59:19 +0100 Subject: WIP: Orphans --- main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index c9fef9a..0c8dd32 100644 --- a/main.go +++ b/main.go @@ -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 { -- cgit v1.2.3-70-g09d2