Documentation ¶
Index ¶
- Constants
- type Config
- type Provider
- func (rp *Provider) Count() int
- func (rp *Provider) Destroy(sessionId string) error
- func (rp *Provider) GC()
- func (rp *Provider) Init(lifeTime int64, redisConfig fasthttpsession.ProviderConfig) error
- func (rp *Provider) NeedGC() bool
- func (rp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
- func (rp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
- type Store
Constants ¶
View Source
const ProviderName = "redis"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Redis server host Host string // Redis server port Port int64 // Maximum number of idle connections in the redis server pool. MaxIdle int // Close connections after remaining idle for this duration. If the value // is zero, then idle connections are not closed. Applications should set // the timeout to a value less than the server's timeout. // (s) IdleTimeout int64 // redis server conn auth, default "" Password string // select db number, default 0 DbNumber int // sessionId as redis key prefix KeyPrefix string // session value serialize func SerializeFunc func(data map[string]interface{}) ([]byte, error) // session value unSerialize func UnSerializeFunc func(data []byte) (map[string]interface{}, error) }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) Init ¶
func (rp *Provider) Init(lifeTime int64, redisConfig fasthttpsession.ProviderConfig) error
init provider config
func (*Provider) ReadStore ¶
func (rp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
read session store by session id
func (*Provider) Regenerate ¶
func (rp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
regenerate session
type Store ¶
type Store struct {
fasthttpsession.Store
}
func NewRedisStoreData ¶
new redis store data
Click to show internal directories.
Click to hide internal directories.