session

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

SessionOn = true SessionProvider = postgresql SessionSavePath = "user=a password=b dbname=c sslmode=disable" SessionName = session

Usage: import(

_ "github.com/astaxie/beego/session/postgresql"
"github.com/astaxie/beego/session"

)

func init() {
	globalSessions, _ = session.NewManager("postgresql", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}``)
	go globalSessions.GC()
}

more docs: http://beego.me/docs/module/session.md

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
}

postgresql session provider

func (*PostgresqlProvider) SessionAll

func (mp *PostgresqlProvider) SessionAll() int

count values in postgresql session

func (*PostgresqlProvider) SessionDestroy

func (mp *PostgresqlProvider) SessionDestroy(sid string) error

delete postgresql session by sid

func (*PostgresqlProvider) SessionExist

func (mp *PostgresqlProvider) SessionExist(sid string) bool

check postgresql session exist

func (*PostgresqlProvider) SessionGC

func (mp *PostgresqlProvider) SessionGC()

delete expired values in postgresql session

func (*PostgresqlProvider) SessionInit

func (mp *PostgresqlProvider) SessionInit(maxlifetime int64, savePath string) error

init postgresql session. savepath is the connection string of postgresql.

func (*PostgresqlProvider) SessionRead

func (mp *PostgresqlProvider) SessionRead(sid string) (session.SessionStore, error)

get postgresql session by sid

func (*PostgresqlProvider) SessionRegenerate

func (mp *PostgresqlProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error)

generate new sid for postgresql session

type PostgresqlSessionStore

type PostgresqlSessionStore struct {
	// contains filtered or unexported fields
}

postgresql session store

func (*PostgresqlSessionStore) Delete

func (st *PostgresqlSessionStore) Delete(key interface{}) error

delete value in postgresql session

func (*PostgresqlSessionStore) Flush

func (st *PostgresqlSessionStore) Flush() error

clear all values in postgresql session

func (*PostgresqlSessionStore) Get

func (st *PostgresqlSessionStore) Get(key interface{}) interface{}

get value from postgresql session

func (*PostgresqlSessionStore) SessionID

func (st *PostgresqlSessionStore) SessionID() string

get session id of this postgresql session store

func (*PostgresqlSessionStore) SessionRelease

func (st *PostgresqlSessionStore) SessionRelease(w http.ResponseWriter)

save postgresql session values to database. must call this method to save values to database.

func (*PostgresqlSessionStore) Set

func (st *PostgresqlSessionStore) Set(key, value interface{}) error

set value in postgresql session. it is temp value in map.

Jump to

Keyboard shortcuts

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