Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: go/src/infra/tricium/service/workflow-launcher/handlers.go

Issue 2125603002: Adds initial Tricium service GAE configs (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 package handlers
2
3 import (
4 "fmt"
5 "net/http"
6
7 "appengine"
8 "appengine/taskqueue"
9 )
10
11 func init() {
12 http.HandleFunc("/workflow-launcher/status", statusPageHandler)
13 http.HandleFunc("/workflow-launcher/queue-handler", queueHandler)
14 }
15
16 func statusPageHandler(w http.ResponseWriter, r *http.Request) {
17 fmt.Fprint(w, statusPage)
18 }
19
20 func queueHandler(w http.ResponseWriter, r *http.Request) {
21 ctx := appengine.NewContext(r)
22
23 // TODO(emso): Process request and launch workflow
24
25 // Enqueue workflow listener task
26 t := taskqueue.NewPOSTTask("/workflow-listener/queue-handler", map[strin g][]string{"name": {"Workflow Launched"}})
27 if _, err := taskqueue.Add(ctx, t, "workflow-listener-queue"); err != ni l {
28 http.Error(w, err.Error(), http.StatusInternalServerError)
29 return
30 }
31 }
32
33 var statusPage = `
34 <html>
35 <head><title>Tricium</title></head>
36 <body>
37 <font face="sans-serif">
38 == T R I C I U M (Under Construction) ==
39 <hr size="1">
40 <p>Status of the Workflow Launcher ...</p>
41 <hr size="1">
42 </body>
43 </html>`
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698