beego: Index | Files

package couchbase

import ""

Package couchbase for session provider

depend on

go install

Usage: import(

_ ""


func init() {
	globalSessions, _ = session.NewManager("couchbase", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}``)
	go globalSessions.GC()

more docs:


Package Files


type Provider Uses

type Provider beecb.Provider

Provider couchabse provided

func (*Provider) SessionAll Uses

func (cp *Provider) SessionAll() int

SessionAll return all active session

func (*Provider) SessionDestroy Uses

func (cp *Provider) SessionDestroy(sid string) error

SessionDestroy Remove bucket in this couchbase

func (*Provider) SessionExist Uses

func (cp *Provider) SessionExist(sid string) bool

SessionExist Check couchbase session exist. it checkes sid exist or not.

func (*Provider) SessionGC Uses

func (cp *Provider) SessionGC()

SessionGC Recycle

func (*Provider) SessionInit Uses

func (cp *Provider) SessionInit(maxlifetime int64, savePath string) error

SessionInit init couchbase session savepath like couchbase server REST/JSON URL e.g. http://host:port/, Pool, Bucket

func (*Provider) SessionRead Uses

func (cp *Provider) SessionRead(sid string) (session.Store, error)

SessionRead read couchbase session by sid

func (*Provider) SessionRegenerate Uses

func (cp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)

SessionRegenerate remove oldsid and use sid to generate new session

type SessionStore Uses

type SessionStore beecb.SessionStore

SessionStore store each session

func (*SessionStore) Delete Uses

func (cs *SessionStore) Delete(key interface{}) error

Delete value in couchbase session by given key

func (*SessionStore) Flush Uses

func (cs *SessionStore) Flush() error

Flush Clean all values in couchbase session

func (*SessionStore) Get Uses

func (cs *SessionStore) Get(key interface{}) interface{}

Get value from couchabse session

func (*SessionStore) SessionID Uses

func (cs *SessionStore) SessionID() string

SessionID Get couchbase session store id

func (*SessionStore) SessionRelease Uses

func (cs *SessionStore) SessionRelease(w http.ResponseWriter)

SessionRelease Write couchbase session with Gob string

func (*SessionStore) Set Uses

func (cs *SessionStore) Set(key, value interface{}) error

Set value to couchabse session

Package couchbase imports 4 packages (graph). Updated 2020-11-07. Refresh now. Tools for package owners.