package
0.0.0-20140208234550-8ce6181c2609
Repository: https://github.com/codegangsta/martini-contrib.git
Documentation: pkg.go.dev

# README

web.Context

hoisie web.go's Context for Martini.

API Reference

Description

web.Context provides a web.go compitable layer for reusing the code written with hoisie's web.go framework. Here compitable means we can use web.Context the same way as in hoisie's web.go but not the others.

Usage

package main

import (
   "github.com/codegangsta/martini"
   "github.com/codegangsta/martini-contrib/web"
 )

func main() {
  m := martini.Classic()
  m.Use(web.ContextWithCookieSecret(""))

  m.Post("/hello", func(ctx *web.Context){
  	  ctx.WriteString("Hello World!")
  })

  m.Run()
}

Authors

# Functions

if cookie secret is set to "", then SetSecureCookie would not work.
NewCookie is a helper method that returns a new http.Cookie object.

# Structs

A Context object is created for every incoming HTTP request, and is passed to handlers as an optional first argument.