session

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CouchbaseProvider

type CouchbaseProvider struct {
	// contains filtered or unexported fields
}

CouchbaseProvider represents a couchbase session provider implementation.

func (*CouchbaseProvider) Count

func (p *CouchbaseProvider) Count() int

Count counts and returns number of sessions.

func (*CouchbaseProvider) Destory

func (p *CouchbaseProvider) Destory(sid string) error

Destory deletes a session by session ID.

func (*CouchbaseProvider) Exist

func (p *CouchbaseProvider) Exist(sid string) bool

Exist returns true if session with given ID exists.

func (*CouchbaseProvider) GC

func (p *CouchbaseProvider) GC()

GC calls GC to clean expired sessions.

func (*CouchbaseProvider) Init

func (p *CouchbaseProvider) Init(maxlifetime int64, connStr string) error

Init initializes memory session provider. connStr is couchbase server REST/JSON URL e.g. http://host:port/, Pool, Bucket

func (*CouchbaseProvider) Read

func (p *CouchbaseProvider) Read(sid string) (session.RawStore, error)

Read returns raw session store by session ID.

func (*CouchbaseProvider) Regenerate

func (p *CouchbaseProvider) Regenerate(oldsid, sid string) (session.RawStore, error)

Regenerate regenerates a session store from old session ID to new one.

type CouchbaseSessionStore

type CouchbaseSessionStore struct {
	// contains filtered or unexported fields
}

CouchbaseSessionStore represents a couchbase session store implementation.

func (*CouchbaseSessionStore) Delete

func (s *CouchbaseSessionStore) Delete(key interface{}) error

Delete delete a key from session.

func (*CouchbaseSessionStore) Flush

func (s *CouchbaseSessionStore) Flush() error

Flush deletes all session data.

func (*CouchbaseSessionStore) Get

func (s *CouchbaseSessionStore) Get(key interface{}) interface{}

Get gets value by given key in session.

func (*CouchbaseSessionStore) ID

func (s *CouchbaseSessionStore) ID() string

ID returns current session ID.

func (*CouchbaseSessionStore) Release

func (s *CouchbaseSessionStore) Release() error

Release releases resource and save data to provider.

func (*CouchbaseSessionStore) Set

func (s *CouchbaseSessionStore) Set(key, val interface{}) error

Set sets value to given key in session.

Jump to

Keyboard shortcuts

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