couchbase

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: LGPL-3.0 Imports: 4 Imported by: 0

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/W3-Engineers-Ltd/Radiant/server/web/session/couchbase"
"github.com/W3-Engineers-Ltd/Radiant/server/web/session"

)

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

more docs: http://radiant.me/docs/module/session.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider radicalcb.Provider

Provider couchabse provided

func (*Provider) SessionAll

func (cp *Provider) SessionAll() int

SessionAll return all active session

func (*Provider) SessionDestroy

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

SessionDestroy Remove bucket in this couchbase

func (*Provider) SessionExist

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

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

func (*Provider) SessionGC

func (cp *Provider) SessionGC()

SessionGC Recycle

func (*Provider) SessionInit

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

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

SessionRead read couchbase session by sid

func (*Provider) SessionRegenerate

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

SessionRegenerate remove oldsid and use sid to generate new session

type SessionStore

type SessionStore radicalcb.SessionStore

SessionStore store each session

func (*SessionStore) Delete

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

Delete value in couchbase session by given key

func (*SessionStore) Flush

func (cs *SessionStore) Flush() error

Flush Clean all values in couchbase session

func (*SessionStore) Get

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

Get value from couchabse session

func (*SessionStore) SessionID

func (cs *SessionStore) SessionID() string

SessionID Get couchbase session store id

func (*SessionStore) SessionRelease

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

SessionRelease Write couchbase session with Gob string

func (*SessionStore) Set

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

Set value to couchabse session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL