Documentation ¶
Index ¶
- type PostgresqlProvider
- func (p *PostgresqlProvider) Count() int
- func (p *PostgresqlProvider) Destory(sid string) (err error)
- func (p *PostgresqlProvider) Exist(sid string) bool
- func (mp *PostgresqlProvider) GC()
- func (p *PostgresqlProvider) Init(maxlifetime int64, connStr string) error
- func (p *PostgresqlProvider) Read(sid string) (session.RawStore, error)
- func (p *PostgresqlProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type PostgresqlSessionStore
- func (s *PostgresqlSessionStore) Delete(key interface{}) error
- func (s *PostgresqlSessionStore) Flush() error
- func (s *PostgresqlSessionStore) Get(key interface{}) interface{}
- func (s *PostgresqlSessionStore) ID() string
- func (s *PostgresqlSessionStore) Release() error
- func (s *PostgresqlSessionStore) Set(key, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresqlProvider ¶
type PostgresqlProvider struct {
// contains filtered or unexported fields
}
PostgresqlProvider represents a postgresql session provider implementation.
func (*PostgresqlProvider) Count ¶
func (p *PostgresqlProvider) Count() int
Count counts and returns number of sessions.
func (*PostgresqlProvider) Destory ¶
func (p *PostgresqlProvider) Destory(sid string) (err error)
Destory deletes a session by session ID.
func (*PostgresqlProvider) Exist ¶
func (p *PostgresqlProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*PostgresqlProvider) GC ¶
func (mp *PostgresqlProvider) GC()
GC calls GC to clean expired sessions.
func (*PostgresqlProvider) Init ¶
func (p *PostgresqlProvider) Init(maxlifetime int64, connStr string) error
Init initializes memory session provider.
func (*PostgresqlProvider) Read ¶
func (p *PostgresqlProvider) Read(sid string) (session.RawStore, error)
Read returns raw session store by session ID.
func (*PostgresqlProvider) Regenerate ¶
func (p *PostgresqlProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type PostgresqlSessionStore ¶
type PostgresqlSessionStore struct {
// contains filtered or unexported fields
}
PostgresqlSessionStore represents a postgresql session store implementation.
func (*PostgresqlSessionStore) Delete ¶
func (s *PostgresqlSessionStore) Delete(key interface{}) error
Delete delete a key from session.
func (*PostgresqlSessionStore) Flush ¶
func (s *PostgresqlSessionStore) Flush() error
Flush deletes all session data.
func (*PostgresqlSessionStore) Get ¶
func (s *PostgresqlSessionStore) Get(key interface{}) interface{}
Get gets value by given key in session.
func (*PostgresqlSessionStore) ID ¶
func (s *PostgresqlSessionStore) ID() string
ID returns current session ID.
func (*PostgresqlSessionStore) Release ¶
func (s *PostgresqlSessionStore) Release() error
save postgresql session values to database. must call this method to save values to database.
func (*PostgresqlSessionStore) Set ¶
func (s *PostgresqlSessionStore) Set(key, value interface{}) error
Set sets value to given key in session.