Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/_support/fake-auth-backend.go')
-rw-r--r--workhorse/_support/fake-auth-backend.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/workhorse/_support/fake-auth-backend.go b/workhorse/_support/fake-auth-backend.go
new file mode 100644
index 00000000000..17dbcb3b35f
--- /dev/null
+++ b/workhorse/_support/fake-auth-backend.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+ "os"
+
+ "gitlab.com/gitlab-org/labkit/log"
+)
+
+func main() {
+ if len(os.Args) == 1 {
+ fmt.Fprintf(os.Stderr, "Usage: %s /path/to/test-repo.git\n", os.Args[0])
+ os.Exit(1)
+ }
+
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, `{"RepoPath":"%s","ArchivePath":"%s"}`, os.Args[1], r.URL.Path)
+ })
+
+ log.Fatal(http.ListenAndServe("localhost:8080", nil))
+}