diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-12-23 07:59:19 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-12-23 08:24:22 +0100 |
commit | d945fe936d250877e141fce748783d4fc7d591de (patch) | |
tree | 444c722ad7ec0f62b96c1eb2a4e804998d7208b4 /main.go | |
parent | d7c775a7d2df82316255a42475f7a58bdd79c7ea (diff) | |
download | gallery-d945fe936d250877e141fce748783d4fc7d591de.tar.gz gallery-d945fe936d250877e141fce748783d4fc7d591de.tar.xz gallery-d945fe936d250877e141fce748783d4fc7d591de.zip |
WIP: Orphans
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 { |