aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-23 07:59:19 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-23 08:24:22 +0100
commitd945fe936d250877e141fce748783d4fc7d591de (patch)
tree444c722ad7ec0f62b96c1eb2a4e804998d7208b4 /main.go
parentd7c775a7d2df82316255a42475f7a58bdd79c7ea (diff)
downloadgallery-d945fe936d250877e141fce748783d4fc7d591de.tar.gz
gallery-d945fe936d250877e141fce748783d4fc7d591de.tar.xz
gallery-d945fe936d250877e141fce748783d4fc7d591de.zip
WIP: Orphans
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 {