Documentation ¶
Index ¶
- Constants
- type Config
- type Provider
- func (rp *Provider) Count() int
- func (rp *Provider) Destroy(sessionID []byte) error
- func (rp *Provider) GC()
- func (rp *Provider) Get(sessionID []byte) (session.Storer, error)
- func (rp *Provider) Init(expiration time.Duration, cfg session.ProviderConfig) error
- func (rp *Provider) NeedGC() bool
- func (rp *Provider) Put(store session.Storer)
- func (rp *Provider) Regenerate(oldID, newID []byte) (session.Storer, error)
- type Store
Constants ¶
View Source
const ProviderName = "redis"
ProviderName redis provider name
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 socket connections. PoolSize 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(src session.Dict) ([]byte, error) // session value unSerialize func UnSerializeFunc func(dst *session.Dict, src []byte) error }
Config session redis config
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provider struct
func (*Provider) GC ¶
func (rp *Provider) GC()
GC session redis provider not need garbage collection
Click to show internal directories.
Click to hide internal directories.