Documentation ¶
Index ¶
- type VirtualSessionProvider
- func (o *VirtualSessionProvider) Count() int
- func (o *VirtualSessionProvider) Destroy(sid string) error
- func (o *VirtualSessionProvider) Exist(sid string) bool
- func (o *VirtualSessionProvider) GC()
- func (o *VirtualSessionProvider) Init(gclifetime int64, config string) error
- func (o *VirtualSessionProvider) Read(sid string) (session.RawStore, error)
- func (o *VirtualSessionProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type VirtualStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VirtualSessionProvider ¶
type VirtualSessionProvider struct {
// contains filtered or unexported fields
}
VirtualSessionProvider represents a shadowed session provider implementation.
func (*VirtualSessionProvider) Count ¶
func (o *VirtualSessionProvider) Count() int
Count counts and returns number of sessions.
func (*VirtualSessionProvider) Destroy ¶ added in v1.10.0
func (o *VirtualSessionProvider) Destroy(sid string) error
Destroy deletes a session by session ID.
func (*VirtualSessionProvider) Exist ¶
func (o *VirtualSessionProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*VirtualSessionProvider) GC ¶
func (o *VirtualSessionProvider) GC()
GC calls GC to clean expired sessions.
func (*VirtualSessionProvider) Init ¶
func (o *VirtualSessionProvider) Init(gclifetime int64, config string) error
Init initializes the cookie session provider with given root path.
func (*VirtualSessionProvider) Read ¶
func (o *VirtualSessionProvider) Read(sid string) (session.RawStore, error)
Read returns raw session store by session ID.
func (*VirtualSessionProvider) Regenerate ¶
func (o *VirtualSessionProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type VirtualStore ¶
type VirtualStore struct {
// contains filtered or unexported fields
}
VirtualStore represents a virtual session store implementation.
func NewVirtualStore ¶
func NewVirtualStore(p *VirtualSessionProvider, sid string, kv map[interface{}]interface{}) *VirtualStore
NewVirtualStore creates and returns a virtual session store.
func (*VirtualStore) Delete ¶
func (s *VirtualStore) Delete(key interface{}) error
Delete delete a key from session.
func (*VirtualStore) Get ¶
func (s *VirtualStore) Get(key interface{}) interface{}
Get gets value by given key in session.
func (*VirtualStore) Release ¶
func (s *VirtualStore) Release() error
Release releases resource and save data to provider.
func (*VirtualStore) Set ¶
func (s *VirtualStore) Set(key, val interface{}) error
Set sets value to given key in session.