aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 17 insertions, 0 deletions
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(&params); 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 {