Documentation ¶
Index ¶
- type MemProvider
- func (p *MemProvider) Count() int
- func (p *MemProvider) Destory(sid string) error
- func (p *MemProvider) Exist(sid string) bool
- func (p *MemProvider) GC()
- func (p *MemProvider) Init(maxLifetime int64, _ string) error
- func (p *MemProvider) Read(sid string) (_ session.RawStore, err error)
- func (p *MemProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type MemStore
- type VirtualSessionProvider
- func (o *VirtualSessionProvider) Count() int
- func (o *VirtualSessionProvider) Destory(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 MemProvider ¶
type MemProvider struct {
// contains filtered or unexported fields
}
MemProvider represents a in-memory session provider implementation.
func (*MemProvider) Count ¶
func (p *MemProvider) Count() int
Count counts and returns number of sessions.
func (*MemProvider) Destory ¶
func (p *MemProvider) Destory(sid string) error
Destory deletes a session by session ID.
func (*MemProvider) Exist ¶
func (p *MemProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*MemProvider) Init ¶
func (p *MemProvider) Init(maxLifetime int64, _ string) error
Init initializes memory session provider.
func (*MemProvider) Read ¶
func (p *MemProvider) Read(sid string) (_ session.RawStore, err error)
Read returns raw session store by session ID.
func (*MemProvider) Regenerate ¶
func (p *MemProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore represents a in-memory session store implementation.
func NewMemStore ¶
NewMemStore creates and returns a memory session store.
func (*MemStore) Get ¶
func (s *MemStore) Get(key interface{}) interface{}
Get gets value by given key in session.
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) Destory ¶
func (o *VirtualSessionProvider) Destory(sid string) error
Destory 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.