Documentation ¶
Overview ¶
Package couchbase for session provider
depend on github.com/couchbaselabs/go-couchbasee
go install github.com/couchbaselabs/go-couchbase
Usage: import(
_ "github.com/astaxie/beego/session/couchbase" "github.com/astaxie/beego/session"
)
func init() { globalSessions, _ = session.NewManager("couchbase", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}``) go globalSessions.GC() }
more docs: http://beego.me/docs/module/session.md
Index ¶
- type Provider
- func (cp *Provider) SessionAll() int
- func (cp *Provider) SessionDestroy(sid string) error
- func (cp *Provider) SessionExist(sid string) bool
- func (cp *Provider) SessionGC()
- func (cp *Provider) SessionInit(maxlifetime int64, savePath string) error
- func (cp *Provider) SessionRead(sid string) (session.Store, error)
- func (cp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)
- type SessionStore
- func (cs *SessionStore) Delete(key interface{}) error
- func (cs *SessionStore) Flush() error
- func (cs *SessionStore) Get(key interface{}) interface{}
- func (cs *SessionStore) SessionID() string
- func (cs *SessionStore) SessionRelease(w http.ResponseWriter)
- func (cs *SessionStore) Set(key, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶ added in v1.6.0
type Provider struct {
// contains filtered or unexported fields
}
Provider couchabse provided
func (*Provider) SessionAll ¶ added in v1.6.0
SessionAll return all active session
func (*Provider) SessionDestroy ¶ added in v1.6.0
SessionDestroy Remove bucket in this couchbase
func (*Provider) SessionExist ¶ added in v1.6.0
SessionExist Check couchbase session exist. it checkes sid exist or not.
func (*Provider) SessionInit ¶ added in v1.6.0
SessionInit init couchbase session savepath like couchbase server REST/JSON URL e.g. http://host:port/, Pool, Bucket
func (*Provider) SessionRead ¶ added in v1.6.0
SessionRead read couchbase session by sid
type SessionStore ¶ added in v1.6.0
type SessionStore struct {
// contains filtered or unexported fields
}
SessionStore store each session
func (*SessionStore) Delete ¶ added in v1.6.0
func (cs *SessionStore) Delete(key interface{}) error
Delete value in couchbase session by given key
func (*SessionStore) Flush ¶ added in v1.6.0
func (cs *SessionStore) Flush() error
Flush Clean all values in couchbase session
func (*SessionStore) Get ¶ added in v1.6.0
func (cs *SessionStore) Get(key interface{}) interface{}
Get value from couchabse session
func (*SessionStore) SessionID ¶ added in v1.6.0
func (cs *SessionStore) SessionID() string
SessionID Get couchbase session store id
func (*SessionStore) SessionRelease ¶ added in v1.6.0
func (cs *SessionStore) SessionRelease(w http.ResponseWriter)
SessionRelease Write couchbase session with Gob string
func (*SessionStore) Set ¶ added in v1.6.0
func (cs *SessionStore) Set(key, value interface{}) error
Set value to couchabse session