Documentation
¶
Index ¶
- Constants
- type Config
- type DBRow
- type Dao
- type Provider
- func (pp *Provider) Count() int
- func (pp *Provider) Destroy(sessionID []byte) error
- func (pp *Provider) GC()
- func (pp *Provider) Get(sessionID []byte) (session.Storer, error)
- func (pp *Provider) Init(expiration time.Duration, cfg session.ProviderConfig) error
- func (pp *Provider) NeedGC() bool
- func (pp *Provider) Put(store session.Storer)
- func (pp *Provider) Regenerate(oldID, newID []byte) (session.Storer, error)
- type Store
Constants ¶
View Source
const ProviderName = "postgres"
ProviderName postgres provider name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// The host to connect to. Values that start with / are for unix domain sockets. (default is localhost)
Host string
// The port to bind to. (default is 5432)
Port int64
// postgres user to sign in as
Username string
// postgres user's password
Password string
// Maximum wait for connection, in seconds. Zero or
// not specified means wait indefinitely.
ConnTimeout int64
// name of the database to connect to
Database string
// session table name
TableName string
// postgres max free idle
SetMaxIdleConn int
// postgres max open idle
SetMaxOpenConn int
// session value serialize func
SerializeFunc func(src session.Dict) ([]byte, error)
// session value unSerialize func
UnSerializeFunc func(dst *session.Dict, src []byte) error
}
Config session postgres configuration
func NewConfigWith ¶
func NewConfigWith(host string, port int64, username string, password string, dbName string, tableName string) *Config
NewConfigWith instance new configuration with especific paremters
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig return default configuration
type DBRow ¶
type DBRow struct {
// contains filtered or unexported fields
}
DBRow database row definition
Click to show internal directories.
Click to hide internal directories.