Documentation ¶
Index ¶
- Constants
- type Config
- type Provider
- func (mcp *Provider) Count() int
- func (mcp *Provider) Destroy(sessionId string) error
- func (mcp *Provider) GC()
- func (mcp *Provider) Init(lifeTime int64, memCacheConfig fasthttpsession.ProviderConfig) error
- func (mcp *Provider) NeedGC() bool
- func (mcp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
- func (mcp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
- type Store
Constants ¶
View Source
const ProviderName = "memcache"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // memcache server list ServerList []string // MaxIdleConns specifies the maximum number of idle connections that will // be maintained per address. If less than one, DefaultMaxIdleConns will be // used. // // Consider your expected traffic rates and latency carefully. This should // be set to a number higher than your peak parallel requests. MaxIdle int // sessionId as memcache 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) GC ¶
func (mcp *Provider) GC()
session memcache provider not need garbage collection
func (*Provider) Init ¶
func (mcp *Provider) Init(lifeTime int64, memCacheConfig fasthttpsession.ProviderConfig) error
init provider config
func (*Provider) ReadStore ¶
func (mcp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)
read session store by session id
func (*Provider) Regenerate ¶
func (mcp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)
regenerate session
type Store ¶
type Store struct {
fasthttpsession.Store
}
func NewMemCacheStoreData ¶
new memCache store data
Click to show internal directories.
Click to hide internal directories.