Beispiel #1
0
func root(ctx *web.Context) string {
	msg := form
	if said, ok := ctx.GetSecureCookie("said"); ok {
		msg = "You said " + said + "<p>" + msg
	}
	return msg
}
Beispiel #2
0
func process(ctx *web.Context) string {
	ctx.ContentType("txt")
	return fmt.Sprintf("%#v", ctx.Params)
}
Beispiel #3
0
// This function will be called prior to each web request
func AuthHandler(ctx *web.Context) error {
	ctx.User = "******"
	fmt.Println(ctx.Request.Header)
	return nil
}
Beispiel #4
0
func i(ctx *web.Context) {
	ctx.Write([]byte("<a href=j>non-nil error"))
}
Beispiel #5
0
func say(ctx *web.Context) {
	ctx.SetSecureCookie("said", ctx.Params["said"], 3600)
	ctx.Redirect(303, "/")
	return
}