示例#1
0
文件: main.go 项目: hyperation/frozen
func template_handler(backend uintptr, request uintptr) int {
	userdata := f.Backend_GetUserdata(backend).(*templateExec_userdata)

	tpl, err := template_load(backend, request)
	if err != "" {
		log.Printf(err)
		return -1
	}

	if err := template_exec(tpl, request, userdata.k_output, userdata.k_input); err != "" {
		log.Printf(err)
		return -1
	}

	return 0
}
示例#2
0
文件: main.go 项目: hyperation/frozen
func templateExecute_handler(backend uintptr, request uintptr) int {
	userdata := f.Backend_GetUserdata(backend).(*templateExec_userdata)

	h := f.Hash([]f.Hskel{
		f.Hitem(f.HK_go_template, f.TYPE_GOINTERFACET, nil),
		f.Hnext(request)})
	if e := f.Backend_pass(backend, h); e < 0 {
		return e
	}
	tpl, ok1 := f.Hget(h, f.HK_go_template).(*template.Template)
	if !ok1 {
		log.Print("templateExecute_handler HK(go_template) not supplied")
		return -1
	}

	err := template_exec(tpl, request, userdata.k_output, userdata.k_input)
	if err != "" {
		log.Printf(err)
		return -1
	}

	return 0
}