1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00
Files
go-inbucket/web/context.go
2012-10-21 09:57:42 -07:00

26 lines
364 B
Go

package web
import (
"github.com/gorilla/sessions"
"net/http"
)
type Context struct {
Session *sessions.Session
}
func (c *Context) Close() {
// Do nothing
}
func NewContext(req *http.Request) (*Context, error) {
sess, err := sessionStore.Get(req, "inbucket")
ctx := &Context{
Session: sess,
}
if err != nil {
return ctx, err
}
return ctx, err
}