Documentation ¶
Index ¶
- Constants
- type Config
- type Provider
- func (mp *Provider) Count() int
- func (mp *Provider) Destroy(sessionId string) error
- func (mp *Provider) GC()
- func (mp *Provider) Init(lifeTime int64, mysqlConfig fasthttpsession.ProviderConfig) error
- func (mp *Provider) NeedGC() bool
- func (mp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
- func (mp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
- type Store
Constants ¶
View Source
const ProviderName = "mysql"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // mysql server host Host string // mysql server port Port int // mysql username Username string // mysql password Password string // mysql conn charset Charset string // mysql Collate Collate string // database name Database string // session table name TableName string // mysql conn timeout(s) Timeout int // mysql read timeout(s) ReadTimeout int // mysql write timeout(s) WriteTimeout int // mysql max free idle SetMaxIdleConn int // mysql 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) Init ¶
func (mp *Provider) Init(lifeTime int64, mysqlConfig fasthttpsession.ProviderConfig) error
init provider config
func (*Provider) ReadStore ¶
func (mp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
read session store by session id
func (*Provider) Regenerate ¶
func (mp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
regenerate session
type Store ¶
type Store struct {
fasthttpsession.Store
}
func NewMysqlStoreData ¶
new mysql store data
Click to show internal directories.
Click to hide internal directories.