Documentation ¶
Overview ¶
This package provides memcached support for session on Kwiscale Framework.
To use it, you need to import the package in your application to let runtime call the "init()" function.
import _ "gopkg.in/kwiscale/session-memcached"
Kwiscale will now be able to use session-memcached it you set your App configuration to "memcached":
app := kwiscale.NewApp(&kwiscale.Config{ SessionEgnine : "memcached", SessionEngineOptions: SessionEngineOptions{ "servers" : "192.168.1.5:11211" } })
The "servers" options could be a coma separated list in string or a slices of strings:
app := kwiscale.NewApp(&kwiscale.Config{ SessionEgnine : "memcached", SessionEngineOptions: SessionEngineOptions{ "servers" : []string{ "192.168.1.5:11211", "192.168.1.6:11211", "192.168.1.7:11211", "192.168.1.8:11211", } } })
Index ¶
- type MemcachedSessionEngine
- func (mc *MemcachedSessionEngine) Clean(handler kwiscale.WebHandler)
- func (mc *MemcachedSessionEngine) Get(handler kwiscale.WebHandler, key interface{}) (interface{}, error)
- func (mc *MemcachedSessionEngine) Init()
- func (mc *MemcachedSessionEngine) Name(name string)
- func (mc *MemcachedSessionEngine) Set(handler kwiscale.WebHandler, key, value interface{})
- func (mc *MemcachedSessionEngine) SetOptions(options kwiscale.SessionEngineOptions)
- func (mc *MemcachedSessionEngine) SetSecret(s []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemcachedSessionEngine ¶
type MemcachedSessionEngine struct {
// contains filtered or unexported fields
}
Implement ISessionStore
func (*MemcachedSessionEngine) Clean ¶
func (mc *MemcachedSessionEngine) Clean(handler kwiscale.WebHandler)
Clean removes the entire values in session.
func (*MemcachedSessionEngine) Get ¶
func (mc *MemcachedSessionEngine) Get(handler kwiscale.WebHandler, key interface{}) (interface{}, error)
Get a value from the session.
func (*MemcachedSessionEngine) Init ¶
func (mc *MemcachedSessionEngine) Init()
Register session-memcached in kwiscale.
func (*MemcachedSessionEngine) Name ¶
func (mc *MemcachedSessionEngine) Name(name string)
Name set the name of session (ie. the session cookie name too).
func (*MemcachedSessionEngine) Set ¶
func (mc *MemcachedSessionEngine) Set(handler kwiscale.WebHandler, key, value interface{})
Set value to the session.
func (*MemcachedSessionEngine) SetOptions ¶
func (mc *MemcachedSessionEngine) SetOptions(options kwiscale.SessionEngineOptions)
SetOptions is used here to set servers addresses. Example:
app := kwiscale.NewApp(&kwiscale.Config{ SessionEngine: "memcached", SessionengineOptions: SessionEngineOptions{ "servers" : "192.168.1.1:11211,192.168.1.2:11211", // required "prefix" : "prefix_string", // optionnal } })
The "servers" list could be a []string or a coma separated list.
func (*MemcachedSessionEngine) SetSecret ¶
func (mc *MemcachedSessionEngine) SetSecret(s []byte)
Set secret []byte to encode session.