示例#1
0
文件: hooks.go 项目: jbaikge/goci
func perform_hook(w http.ResponseWriter, req *http.Request, l work_loader) {
	body := strings.NewReader(req.FormValue("payload"))
	if err := l.Load(body); err != nil {
		log.Println("error loading hook message:", err)
		perform_status(w, nil, http.StatusInternalServerError)
		return
	}
	worker.Schedule(l)
}
示例#2
0
文件: hooks.go 项目: jbaikge/goci
func handle_go_get(w http.ResponseWriter, req *http.Request) {
	imp := req.FormValue(":import")
	if imp == "" {
		log.Println("handle_go_get: package name empty")
		perform_status(w, nil, http.StatusNotFound)
		return
	}
	worker.Schedule(Package{
		Import: imp,
	})
}
示例#3
0
文件: hooks.go 项目: jbaikge/goci
func perform_google_hook(w http.ResponseWriter, req *http.Request, m *google.HookMessage) {
	if err := m.Load(req.Body); err != nil {
		log.Println("error loading hook message:", err)
		perform_status(w, nil, http.StatusInternalServerError)
		return
	}
	switch req.FormValue(":vcs") {
	case "git":
		m.Vcs = builder.Git
	case "hg":
		m.Vcs = builder.HG
	default:
		perform_status(w, nil, http.StatusOK)
		return
	}
	worker.Schedule(m)
}
示例#4
0
文件: foo.go 项目: tcard/goci
//our basic handle index that demonstrates how to get data from the context
//inside a template
func handle_simple_work(w http.ResponseWriter, req *http.Request, ctx *Context) {
	worker.Schedule(test_work)
	log.Println("sent item in")
}