Beispiel #1
0
func main() {
	log.SetFlags(0)
	ctxt := fs.NewContext(new(http.Request))
	if err := dashboard.Update(ctxt, nil, "Go 1.2"); err != nil {
		log.Fatal(err)
	}
	log.Print("OK")
}
Beispiel #2
0
func AdminDashboard(w http.ResponseWriter, req *http.Request) {
	version := "Go " + strings.TrimPrefix(req.URL.Path, "/admin/dashboard/")
	ctxt := fs.NewContext(req)
	ctxt.Mkdir("issue-dashboard")
	c := appengine.NewContext(req)
	if err := dashboard.Update(ctxt, urlfetch.Client(c), version); err != nil {
		fmt.Fprintf(w, "Error updating: %s\n", err)
	} else {
		fmt.Fprintf(w, "Updated.\n")
	}
}