Documentation ¶
Index ¶
- Constants
- type Config
- type Provider
- func (pp *Provider) Count() int
- func (pp *Provider) Destroy(sessionId string) error
- func (pp *Provider) GC()
- func (pp *Provider) Init(lifeTime int64, postgresConfig fasthttpsession.ProviderConfig) error
- func (pp *Provider) NeedGC() bool
- func (pp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
- func (pp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
- type Store
Constants ¶
View Source
const ProviderName = "postgres"
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(data map[string]interface{}) ([]byte, error) // session value unSerialize func UnSerializeFunc func(data []byte) (map[string]interface{}, error) }
func NewConfigWith ¶
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) GC ¶
func (pp *Provider) GC()
session postgres provider not need garbage collection
func (*Provider) Init ¶
func (pp *Provider) Init(lifeTime int64, postgresConfig fasthttpsession.ProviderConfig) error
init provider config
func (*Provider) ReadStore ¶
func (pp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
read session store by session id
func (*Provider) Regenerate ¶
func (pp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
regenerate session
type Store ¶
type Store struct {
fasthttpsession.Store
}
func NewPostgresStoreData ¶
new postgres store data
Click to show internal directories.
Click to hide internal directories.