Documentation ¶
Index ¶
Constants ¶
View Source
const DEFAULT_SESSION_NAME string = "gopher.sid"
View Source
const REQUEST_CONTEXT_SESSION_ID = "sessionID"
Variables ¶
View Source
var DISABLE_RESAVE = flag.Bool("DISABLE_RESAVE", false, "")
View Source
var DISABLE_SAVE_UNINITIALIZED = flag.Bool("DISABLE_SAVE_UNINITIALIZED", false, "")
View Source
var ENABLE_RESAVE = flag.Bool("ENABLE_RESAVE", true, "")
View Source
var ENABLE_SAVE_UNINITIALIZED = flag.Bool("ENABLE_SAVE_UNINITIALIZED", true, "")
Functions ¶
This section is empty.
Types ¶
type HTTPCookie ¶
HTTPCookie comment
func (*HTTPCookie) String ¶
func (c *HTTPCookie) String() string
String returns the serialization of the cookie for use in a Cookie header (if only Name and Value are set) or a Set-Cookie response header (if other fields are set). If c is nil or c.Name is invalid, the empty string is returned.
type MemoryStore ¶
type MemoryStore struct { StoreInterface Store }
MemoryStore comment
func (*MemoryStore) SetSession ¶
func (ctx *MemoryStore) SetSession(sess *Session)
SetSession comment
type Middleware ¶
type Middleware struct { SessionID string Store *interface{ StoreInterface } MiddlewareOptions IsResave bool IsSaveUninitialized bool Secret []string // contains filtered or unexported fields }
Middleware comment
func NewMiddleware ¶
func NewMiddleware(handler http.Handler, opts *MiddlewareOptions) (*Middleware, error)
NewMiddleware create new session middleware
func (*Middleware) ServeHTTP ¶
func (ctx *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MiddlewareOptions ¶
type MiddlewareOptions struct { Cookie *HTTPCookie `json:"cookie"` Name string `json:"name"` Store *interface{ StoreInterface } `json:"store"` IsTrustProxy bool `json:"proxy"` IsResave *bool `json:"resave"` IsRolling bool `json:"rolling"` IsSaveUninitialized *bool `json:"saveUninitialized"` UnsetMode *UnsetMode `json:"unset"` Secret *[]string `json:"secret"` }
MiddlewareOptions comment
type Session ¶
type Session struct { ID string Request *http.Request Cookie *HTTPCookie }
Session comment
type StoreInterface ¶
StoreInterface comment
Click to show internal directories.
Click to hide internal directories.