Documentation
¶
Index ¶
- Constants
- type Config
- type Provider
- func (mcp *Provider) Count() int
- func (mcp *Provider) Destroy(sessionID []byte) error
- func (mcp *Provider) GC()
- func (mcp *Provider) Get(sessionID []byte) (session.Storer, error)
- func (mcp *Provider) Init(lifeTime int64, cfg session.ProviderConfig) error
- func (mcp *Provider) NeedGC() bool
- func (mcp *Provider) Put(store session.Storer)
- func (mcp *Provider) Regenerate(oldID, newID []byte) (session.Storer, error)
- type Store
Constants ¶
View Source
const ProviderName = "memcache"
ProviderName memcache provider name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ServerList 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.
MaxIdleConns int
// KeyPrefix sessionID as memcache key prefix
KeyPrefix string
// SerializeFunc session value serialize func
SerializeFunc func(src session.Dict) ([]byte, error)
// UnSerializeFunc session value unSerialize func
UnSerializeFunc func(dst *session.Dict, src []byte) error
}
Config session memcache configuration
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provider struct
func (*Provider) GC ¶
func (mcp *Provider) GC()
GC session memcache provider not need garbage collection
Click to show internal directories.
Click to hide internal directories.