session

package
v2.0.0-beta1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2015 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL