Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterType ¶
func RegisterType(value interface{})
func RegisterTypeName ¶
func RegisterTypeName(name string, value interface{})
func UseAsDefault ¶
func UseAsDefault(manager *Manager)
UseAsDefault use the given session manager as the default
Types ¶
type Config ¶
type Config struct { CookieName string `xml:"cookieName,attr"` CookiePath string `xml:"cookiePath,attr"` EnableSetCookie bool `xml:"enableSetCookie,attr"` GcLifetime int64 `xml:"gcLifetime,attr"` MaxLifetime int64 `xml:"maxLifetime,attr"` Secure bool `xml:"secure,attr"` HTTPOnly bool `xml:"httpOnly,attr"` CookieLifeTime int `xml:"cookieLifeTime,attr"` ProviderConfig string `xml:"providerConfig,attr"` Domain string `xml:"domain,attr"` }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager the session manager struct
func CreateManager ¶
func (*Manager) RegenerateID ¶
RegenerateID Regenerate a session id for this Storage who's id is saving in http request.
type Provider ¶
type Provider interface { Init(gcLifetime int64, config string) error Read(sid string) Storage Exist(sid string) bool Regenerate(oldSid, sid string) (Storage, error) Destroy(sid string) error All() int //get all active session Update(sid string) error GC() }
Provider contains global session methods and saved SessionStores. it can operate a Storage by its id.
type Storage ¶
type Storage interface { Set(key string, value interface{}) error //set session Value Get(key string) interface{} //get session Value Delete(key string) error //delete session Value ID() string //back current sessionID Release(w http.ResponseWriter) //release the resource & save data to provider & return the data Flush() error //delete all data }
Storage the session store interface
Click to show internal directories.
Click to hide internal directories.